[ 
https://issues.apache.org/jira/browse/WW-3928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13505330#comment-13505330
 ] 

Greg Huber commented on WW-3928:
--------------------------------

I can confirm that || include.endsWith(".jsp") on line below does cause the 
page not to show correctly, because if I remove it the page shows as normal. 

{code:java}

public class StrutsTilesRequestContext extends TilesRequestContextWrapper {

public void dispatch(String include) throws IOException {
        if (include.endsWith(mask) || include.endsWith(".jsp")) {
            // FIXME This way FreeMarker results still don't have a 
content-type!
            include(include);
        } else {
            super.dispatch(include);
        }
    }

public void include(String include) throws IOException {
        if (include.endsWith(mask)) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Intercepting tiles include '" + include + "'. 
Processing as freemarker result.");
            }
           ........... FreemarkerResult stuff
        } else {
            super.include(include);
        }
    }
}

#######

the super. for above (JspTilesRequestContext)

/**
     * Dispatches a path. In fact it "includes" it!
     *
     * @param path The path to dispatch to.
     * @throws IOException If something goes wrong during dispatching.
     * @see 
org.apache.tiles.servlet.context.ServletTilesRequestContext#dispatch(java.lang.String)
     */
    public void dispatch(String path) throws IOException {
        include(path);
    }

    /** {@inheritDoc} */
    public void include(String path) throws IOException {
        JspUtil.setForceInclude(pageContext, true);
        try {
            pageContext.include(path, false);
        } catch (ServletException e) {
            throw wrapServletException(e, "JSPException including path '"
                    + path + "'.");
        }
    }


{code}

But why it does not show when viewed through the apache server as a front end 
is another question. I traced it throught and it basically does the same thing 
(see above dispatch/include), except initially with || include.endsWith(".jsp") 
it calls include below and without it it calls forward.

Maybe there is some condition that if a jsp file is included initially it does 
not render correctly through apache/tomcat mod_jk?  Beyond by expertise!

{code:java}

/**
     * Forwards to a path.
     *
     * @param path The path to forward to.
     * @throws IOException If something goes wrong during the operation.
     */
    protected void forward(String path) throws IOException {
        RequestDispatcher rd = request.getRequestDispatcher(path);

        if (rd == null) {
            throw new IOException("No request dispatcher returned for path '"
                    + path + "'");
        }

        try {
            rd.forward(request, response);
        } catch (ServletException ex) {
            throw wrapServletException(ex, "ServletException including path '"
                    + path + "'.");
        }
    }


    /** {@inheritDoc} */
    public void include(String path) throws IOException {
        ServletUtil.setForceInclude(request, true);
        RequestDispatcher rd = request.getRequestDispatcher(path);

        if (rd == null) {
            throw new IOException("No request dispatcher returned for path '"
                    + path + "'");
        }

        try {
            rd.include(request, response);
        } catch (ServletException ex) {
            throw wrapServletException(ex, "ServletException including path '"
                    + path + "'.");
        }
    }

{code}

Cheers Greg.


                
> JSp pages only show on port 8080 after upgrade to 2.3.7
> -------------------------------------------------------
>
>                 Key: WW-3928
>                 URL: https://issues.apache.org/jira/browse/WW-3928
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.3.7
>         Environment: centos/toncat
>            Reporter: Greg Huber
>             Fix For: 2.3.8
>
>
> Hello,
> I have just upgraded my production environment to 2.3.7 and now the jsp pages 
> only show the html, rather than the compiled page.  If I add the port to the 
> end of the URL they show correctly,  ie http://www.someplace.com:8080.  I 
> have checked the release notes but could not find any information relating to 
> this.  Maybe there is a configuration change needed to make this version work 
> which needs documenting.
> Cheers Greg

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to