1. opensymphony
  2. webwork

Commits

plightbo  committed 840bd21

property tag gets the VS from the request, meaning it will now work with sitemesh. gotta do this for the rest of the tags. oh, and i did code formatting on SD, cuz the format was ASS

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@113573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits e307973
  • Branches master

Comments (0)

Files changed (2)

File src/java/com/opensymphony/webwork/dispatcher/ServletDispatcher.java

View file
     }
 
     /**
- * Service a request - get the namespace, actionName, paramMap, sessionMap, applicationMap from the providers
- * and delegate to the service call
- *
- * @param request
- * @param response
- * @exception javax.servlet.ServletException
- */
+     * Service a request - get the namespace, actionName, paramMap, sessionMap, applicationMap from the providers
+     * and delegate to the service call
+     *
+     * @param request
+     * @param response
+     * @exception javax.servlet.ServletException
+     */
     public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException {
 
-		try {
+        try {
             request = wrapRequest(request);
-	        serviceAction(request, response, getNameSpace(request), getActionName(request), getParameterMap(request), getSessionMap(request), getApplicationMap());
-		} catch (IOException e) {
-			String message = "Could not wrap servlet request with MultipartRequestWrapper!";
-			log.error(message, e);
-			sendError(request, response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, new ServletException(message, e));
-		}
+            serviceAction(request, response, getNameSpace(request), getActionName(request), getParameterMap(request), getSessionMap(request), getApplicationMap());
+        } catch (IOException e) {
+            String message = "Could not wrap servlet request with MultipartRequestWrapper!";
+            log.error(message, e);
+            sendError(request, response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, new ServletException(message, e));
+        }
     }
 
     /**
- * The request is first checked to see if it is a multi-part. If it is, then the request
- * is wrapped so WW will be able to work with the multi-part as if it was a normal request.
- * Then the request is handed to GenericDispatcher and executed.
- */
+     * The request is first checked to see if it is a multi-part. If it is, then the request
+     * is wrapped so WW will be able to work with the multi-part as if it was a normal request.
+     * Then the request is handed to GenericDispatcher and executed.
+     */
     public void serviceAction(HttpServletRequest request, HttpServletResponse response, String namespace, String actionName, Map parameterMap, Map sessionMap, Map applicationMap) {
 
         HashMap extraContext = createContextMap(parameterMap, sessionMap, applicationMap, request, response, getServletConfig());
         }
     }
 
-    public static HashMap createContextMap(Map parameterMap, Map sessionMap, Map applicationMap, 
+    public static HashMap createContextMap(Map parameterMap, Map sessionMap, Map applicationMap,
                                            HttpServletRequest request, HttpServletResponse response,
                                            ServletConfig servletConfig) {
         HashMap extraContext = new HashMap();
     }
 
     /**
- * build the name of the action from the request
- *
- * override this method to customize a ULR -> action name mapping
- */
+     * build the name of the action from the request
+     *
+     * override this method to customize a ULR -> action name mapping
+     */
     protected String getActionName(HttpServletRequest request) {
         String servletPath = (String) request.getAttribute("javax.servlet.include.servlet_path");
 
     }
 
     /**
- * get the namespace of the action from the request
- *
- * override this method to customize a ULR -> action namespace mapping
- */
+     * get the namespace of the action from the request
+     *
+     * override this method to customize a ULR -> action namespace mapping
+     */
     protected String getNameSpace(HttpServletRequest request) {
         // Path is always original path, even if it is included in page with another path
         String servletPath = request.getServletPath();
     }
 
     /**
- * send a http error response
- *
- * @param request
- * @param response
- * @param code the HttpServletResponse error code
- * @param e the exception that needs to be reported on
- */
+     * send a http error response
+     *
+     * @param request
+     * @param response
+     * @param code the HttpServletResponse error code
+     * @param e the exception that needs to be reported on
+     */
     protected void sendError(HttpServletRequest request, HttpServletResponse response, int code, Exception e) {
         try {
             // send a http error response to use the servlet defined error handler
 
             // send the error response
             response.sendError(code, e.getMessage());
-
-            /*
-response.setContentType("text/html");
-response.setLocale(Configuration.getLocale());
-
-PrintWriter writer = response.getWriter();
-writer.write("Error executing action: " + e.getMessage());
-writer.println("<pre>\n");
-e.printStackTrace(response.getWriter());
-writer.print("</pre>\n");
-*/
         } catch (IOException e1) {
         }
     }
 
     /**
- * Determine action name by extracting last string and removing
- * extension. (/.../.../Foo.action -> Foo)
- */
+     * Determine action name by extracting last string and removing
+     * extension. (/.../.../Foo.action -> Foo)
+     */
     String getActionName(String name) {
         // Get action name ("Foo.action" -> "Foo" action)
         int beginIdx = name.lastIndexOf("/");
     }
 
     /**
- * Wrap servlet request with the appropriate request. It will check to
- * see if request is a multipart request and wrap in appropriately.
- *
- * @param request
- * @return wrapped request or original request
- */
+     * Wrap servlet request with the appropriate request. It will check to
+     * see if request is a multipart request and wrap in appropriately.
+     *
+     * @param request
+     * @return wrapped request or original request
+     */
     protected HttpServletRequest wrapRequest(HttpServletRequest request) throws IOException {
         // don't wrap more than once
         if (request instanceof MultiPartRequestWrapper) {

File src/java/com/opensymphony/webwork/views/jsp/PropertyTag.java

View file
     }
 
     public int doStartTag() throws JspException {
-        OgnlValueStack stack = ActionContext.getContext().getValueStack();
+        HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
+        OgnlValueStack stack = (OgnlValueStack) req.getAttribute("webwork.valueStack");
 
         try {
             if (stack == null)
             {
                 stack = new OgnlValueStack();
-                HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
                 HttpServletResponse res = (HttpServletResponse) pageContext.getResponse();
                 Map extraContext = ServletDispatcher.createContextMap(req.getParameterMap(),
                         new SessionMap(req.getSession()),