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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • 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


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

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

<a href="" >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.

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
    Bookmark Topic Watch Topic
  • New Topic