You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Faisal Mahmoud <fa...@gmail.com> on 2005/10/06 01:21:16 UTC

Navigation menu help

I have created a navigation menu jsp file that I include with all the
pages on my webapp via the jsp:include tag. This page has the
following nav menu:

<ul>
<li><a href="/homePage">Home</a></li>
<li><a href="/newJobPage">New Job</a></li>
<li><a href="/retrieveJobPage">Retrieve Job</a></li>
</ul>

I have placed all jsp pages under WEB-INF/jsp/, except for the login
page which resides at WebRoot/index.jsp. The user will access the
index.jsp page, login and then upon succesfull authentication, they
will be forwarded to WEB-INF/jsp/home.jsp. This occurs via a struts
Action class. This action forwards as shown below:

<action path="/userLogin"
type="com.myorg.struts.actions.LoginUserAction"
name="loginFormBean"
input="/index.jsp"
unknown="true"
scope="session"
validate="true">
<forward name="login.success" path="/homePage.do"/>
</action>

I use ActionForwards to perform menu navigation. I specify them as
follows in my struts-config.xml file:

<action path="/homePage"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/jsp/home.jsp"/>
<action path="/newJobPage"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/jsp/newjob.jsp"/>
<action path="/retrieveJobPage"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/jsp/retrievejob.jsp"/>

When the home.jsp loads after the user logs in the menu displays fine.
The links show paths such as
http://localhost:8080/homePage
http://localhost:8080/newJobPage

However, if I click on any of the nav links, I get a Tomcat error page saying:
HTTP Status 404 - /homePage
type Status report
message /homePage
description The requested resource (/homePage) is not available.

This occurs for any of the links. What am I doing wrong here?

-Faisal
--
http://www.quidprocode.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Navigation menu help

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Faisal Mahmoud" <fa...@gmail.com>

> I have created a navigation menu jsp file that I include with all the
> pages on my webapp via the jsp:include tag. This page has the
> following nav menu:
> <a href="/homePage">Home</a>

If you're going to use plain old HTML links, you'll need to include the 
".do" extension.

Otherwise, take a look at <html:link> which has an 'action' attribute.  I 
haven't used it, but it looks like it will do what you want.

-- 
Wendy Smoak 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Navigation menu help

Posted by Su...@Keane.com.
Faisal,

If you are using <a href=""> then you have to provide the path woth 
context name but better way is to use <html:link> instead of <a href="">.
In your case, instead of using <a href="/homePage">Home</a> , you should 
use <html:link  action="/homePage">Home</html:link>. It will definitely 
work.

Sunil




Faisal Mahmoud <fa...@gmail.com> 
06/10/2005 04:51
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
user@struts.apache.org
cc

Subject
Navigation menu help






I have created a navigation menu jsp file that I include with all the
pages on my webapp via the jsp:include tag. This page has the
following nav menu:

<ul>
<li><a href="/homePage">Home</a></li>
<li><a href="/newJobPage">New Job</a></li>
<li><a href="/retrieveJobPage">Retrieve Job</a></li>
</ul>

I have placed all jsp pages under WEB-INF/jsp/, except for the login
page which resides at WebRoot/index.jsp. The user will access the
index.jsp page, login and then upon succesfull authentication, they
will be forwarded to WEB-INF/jsp/home.jsp. This occurs via a struts
Action class. This action forwards as shown below:

<action path="/userLogin"
type="com.myorg.struts.actions.LoginUserAction"
name="loginFormBean"
input="/index.jsp"
unknown="true"
scope="session"
validate="true">
<forward name="login.success" path="/homePage.do"/>
</action>

I use ActionForwards to perform menu navigation. I specify them as
follows in my struts-config.xml file:

<action path="/homePage"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/jsp/home.jsp"/>
<action path="/newJobPage"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/jsp/newjob.jsp"/>
<action path="/retrieveJobPage"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/jsp/retrievejob.jsp"/>

When the home.jsp loads after the user logs in the menu displays fine.
The links show paths such as
http://localhost:8080/homePage
http://localhost:8080/newJobPage

However, if I click on any of the nav links, I get a Tomcat error page 
saying:
HTTP Status 404 - /homePage
type Status report
message /homePage
description The requested resource (/homePage) is not available.

This occurs for any of the links. What am I doing wrong here?

-Faisal
--
http://www.quidprocode.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org