This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts validation problem..

Umar Hathab Abdullah
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a web application deployed on Orion Servert. I am using Struts stuffs.
This is my validation.xml
<form name="employeeForm">
<arg0 key=""/>
In the struts-config.xml, I have the following..
<forward name="employeeform" path="/employeeForm.jsp"/>

<!-- Action Mapping Definitions -->
<action path="/insertEmployee"
input = "employeeform"


When I submit my JSP, And If I dont enter the name field , Validation fails as expected but my request is not getting forwarded.
I am getting this message from the console.
Deligating Via Forward to 'employeeform'.
I am getting Internal Server error on the page.

When I enter the name field, the flow goes fine.
Please help me on this.
Rick Hightower
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default you have to specify the web resource as the input.
If you want to use forwards for your inputs, you have to setup the controller element as follows:
<controller nocache="true" inputForward="true" maxFileSize="2M" />
(Controller element is after action-mappings element but before the message-resource element).
Basically you have to set the inputForward attribute to true.
If you like this answer, check out the book Professional Struts or Struts Live or my company ArcMind.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic