Stripes - HTTP Error 404

classic Classic list List threaded Threaded
5 messages Options
Joe
Reply | Threaded
Open this post in threaded view
|

Stripes - HTTP Error 404

Joe
Hi,

I can't work out why I am getting HTTP Error 404!

This is my ActionBean:

public class ExpenseListActionBean extends BaseActionBean {

    private static final String VIEW = "/WEB-INF/jsp/expense_list.jsp";
    private static final String TABLE = "/WEB_INF/jsp/part/expense_table.jsp";
 
    @DefaultHandler
    public Resolution view() {
        return new ForwardResolution(VIEW);
    }

    public Resolution expenseTable() {
        return new ForwardResolution(TABLE); //(1) breakpoint
    }

}

When I navigate to http://localhost:8080/expenses/ExpenseList.action everything is fine.

However, when I try: http://localhost:8080/expenses/ExpenseList.action?expenseTable=

I have put a breakpoint at (1) and the breakpoint is hit.

I get the HTTP Error 404

Problem accessing /expenses/WEB_INF/jsp/part/expense_table.jsp. Reason:

    NOT_FOUND

The jsp does exist at /WEB_INF/jsp/part/expense_table.jsp.

What is more confusing if I change the method like so:

    public Resolution expenseTable() {
        return new ForwardResolution(VIEW); //Note: return VIEW same as view()
    }

Then when I navigate to: http://localhost:8080/expenses/ExpenseList.action?expenseTable= the
"view" page loads. Breakpoint (1) is still hit.

//////// web.xml //////////

    <filter>
        <filter-name>StripesFilter</filter-name>
        <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
        <init-param>
            <param-name>ActionResolver.Packages</param-name>
            <param-value>package.action</param-value>
        </init-param>
        <init-param>
            <param-name>Extension.Packages</param-name>
            <param-value>package.ext,
                org.stripesstuff.stripersist,
                net.sourceforge.stripes.integration.spring
            </param-value>
        </init-param>
    </filter>
    <servlet>
        <servlet-name>DispatcherServlet</servlet-name>
        <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <filter-mapping>
        <filter-name>StripesFilter</filter-name>
        <servlet-name>DispatcherServlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <servlet-mapping>
        <servlet-name>DispatcherServlet</servlet-name>
        <url-pattern>*.action</url-pattern>
    </servlet-mapping>


Please help.


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Joe
Reply | Threaded
Open this post in threaded view
|

Re: Stripes - HTTP Error 404

Joe
More context - the directory structure and jsp's.

\WEB-INF
    \jsp
        expense_list.jsp
        \common
            layout_blank.jsp
        \part
            expense_table.jsp

layout_blank.jsp

<%@page contentType="text/html;charset=ISO-8859-1" language="java"%>
<%@include file="/WEB-INF/jsp/common/taglibs.jsp"%>

<s:layout-definition>
    <s:layout-component name="body">
        Body goes here
    </s:layout-component>
</s:layout-definition>

expense_table.jsp

<%@ include file="/WEB-INF/jsp/common/taglibs.jsp" %>

<s:layout-render name="/WEB-INF/jsp/common/layout_blank.jsp">
    <s:layout-component name="body">

            <d:table name="${actionBean.expenses}" id="expense" class="table"
                     requestURI="" defaultsort="1" defaultorder="descending" pagesize="10" sort="list">
                <d:column title="Date" property="date" sortable="true"/>
                <d:column title="Amount" property="amount" sortable="true"/>
                <d:column title="Comment" property="comment" sortable="false"/>
                <d:column title="Tags" property="formattedTags" sortable="false"/>
            </d:table>

    </s:layout-component>
</s:layout-render>


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Stripes - HTTP Error 404

Joaquin Valdez-2
I think its this line:

  private static final String TABLE = "/WEB_INF/jsp/part/expense_table.jsp”;   <== notice the underscore  should it be a “-“

Joaquin



> On Nov 15, 2014, at 7:37 PM, Joe <[hidden email]> wrote:
>
> More context - the directory structure and jsp's.
>
> \WEB-INF
>    \jsp
>        expense_list.jsp
>        \common
>            layout_blank.jsp
>        \part
>            expense_table.jsp
>
> layout_blank.jsp
>
> <%@page contentType="text/html;charset=ISO-8859-1" language="java"%>
> <%@include file="/WEB-INF/jsp/common/taglibs.jsp"%>
>
> <s:layout-definition>
>    <s:layout-component name="body">
>        Body goes here
>    </s:layout-component>
> </s:layout-definition>
>
> expense_table.jsp
>
> <%@ include file="/WEB-INF/jsp/common/taglibs.jsp" %>
>
> <s:layout-render name="/WEB-INF/jsp/common/layout_blank.jsp">
>    <s:layout-component name="body">
>
>            <d:table name="${actionBean.expenses}" id="expense" class="table"
>                     requestURI="" defaultsort="1" defaultorder="descending" pagesize="10" sort="list">
>                <d:column title="Date" property="date" sortable="true"/>
>                <d:column title="Amount" property="amount" sortable="true"/>
>                <d:column title="Comment" property="comment" sortable="false"/>
>                <d:column title="Tags" property="formattedTags" sortable="false"/>
>            </d:table>
>
>    </s:layout-component>
> </s:layout-render>
>
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
> _______________________________________________
> Stripes-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Joe
Reply | Threaded
Open this post in threaded view
|

Re: Stripes - HTTP Error 404

Joe
Joaquin - you are right!

It should be WEB-INF not WEB_INF.

What a stupid mistake!


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Stripes - HTTP Error 404

Joaquin Valdez-2
I only spotted it because I have made that mistake myself!! :-)



> On Nov 15, 2014, at 7:47 PM, Joe <[hidden email]> wrote:
>
> Joaquin - you are right!
>
> It should be WEB-INF not WEB_INF.
>
> What a stupid mistake!
>
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
> _______________________________________________
> Stripes-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users