struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brown, Melonie S. - Contractor" <Melonie.Br...@forscom.army.mil>
Subject Dynamic URL's and Actions
Date Tue, 10 Dec 2002 22:16:02 GMT
I have code that generates a navigation bar based on a particular user's set
of permissions. The user logs in, the menu is retrieved into a list, and the
user gets a welcome page with the menu options.  All of that works fine and
dandy. The problem is when I actually try to go someplace from the generated
navigation bar.

I get this error: "The requested resource (/Application/MenuItem1) is not
available".  I don't understand why I'm getting this message. 

The generated html code looks something like this:

<a href="http://localhost:8080/Application/MenuItem1.do">MenuItem1</a>
<a href="http://localhost:8080/Application/MenuItem2.do">MenuItem2</a>
<a href="http://localhost:8080/Application/MenuItem3.do">MenuItem3</a>

The code to generate the above looks like this:
<logic:present name="navBar">
      <logic:iterate id="curLevel" name="navBar">
        	<html:link page='/<bean:write name="curLevel"
property="link" />'>
        		<bean:write name="curLevel" property="description"
/>
        	</html:link>

 and so forth....  

My struts config looks like this:
<action   path="/login"
              type="foo.actions.loginAction"
              name="loginForm"
              scope="request"
              validate = "true"
              input="/index.jsp">
    <forward name="success" path="/welcome.do"/>
    <forward name="failure" path="/login.jsp"/>
    </action>

<action    path="/welcome"
               type="foo.actions.RetrieveMenuItems"
               name="loginForm"
              scope="request"
              validate = "true"
               > 
    <forward name="success" path="/welcome.jsp"/>   
    <forward name="failure" path="/index.jsp"/>
</action>

<action   path="MenuItem1"
              type="foo.actions.RetrieveMenuItems"
              name="loginForm"
              scope="request"
              validate = "true"
              parameter="permissions"
              >
    <forward name="success" path="/somewhere.do"/>
    <forward name="failure" path="/index.jsp"/>
</action>


Any suggestions as to what I'm doing wrong?  I don't seem to find anything
similar to what I'm trying to do, but I have to imagine there are plenty of
other folks doing this.  Suggestions would be greatly appreciated.

Melonie

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


Mime
View raw message