Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Struts-config.xml problem

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am developing struts application
When i click on view Admin i want to transfer the control to struts-config.xml so that i can specify action class for it.But its not working

when i specfiy like this it works perfectly

Menu.jsp
--------


Struts-config.xml
------------------
<global-forwards type="org.apache.struts.action.ActionForward">
<forward name="AdminList.do" path="/AdminList"></forward>
</global-forwards>


by making above changes i get 404 error
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take out the global forward. It's incorrectly written, and completely unnecessary. All you need is the action path definition, and it appears to be correct. When you create an action path definition, that gives you the ability to call the action as a URL with ".do" appended to it.

Then use the following for your link:

<html:link action="/AdminList" >View Admin</html:link>
[ January 27, 2007: Message edited by: Merrill Higginson ]
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,


<a href="AdminList.do" >View Admin</a>



it will not refer to your context root. so use "request.getContextPath()"


but i think you should use html:link tag as Merrill suggest.

milan.
 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic