wood burning stoves*
The moose likes Struts and the fly likes Html:form tag in struts 1.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Html:form tag in struts 1.1" Watch "Html:form tag in struts 1.1" New topic
Author

Html:form tag in struts 1.1

ajay solanki
Ranch Hand

Joined: Feb 25, 2008
Posts: 37
I am working on an application which uses Struts 1.1. I have defined a Action class and overridden the execute method. I defined that action into struts-config.xml and set the mapping in web.xml. e.g action path is /newAction.
I used a html:form in jsp page where my action is this action


But when my jsp page renders in browser the action for form tag changes automatic.

Here SampleProject is my project name which is deployed on tomcat server. In my jsp I am using Tiles also.

Please help me to find out the issue behind it.

Thanks in advance
ajay solanki
Ranch Hand

Joined: Feb 25, 2008
Posts: 37
Any solution to this behavior. It will be great if someone could respond to this.

Thanks in advance
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

Hi ,

Try removing the slash "/" from the action name in the html form

Change it to


Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
ajay solanki
Ranch Hand

Joined: Feb 25, 2008
Posts: 37
Thank for reply Asif, I have tried that and it is not working in that case also.

Thanks
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

It still doesn't work. Then I will require some additional information to look into the matter. Kindly provide me your struts-config.xml and your web.xml file. I need to see all mappings.
ajay solanki
Ranch Hand

Joined: Feb 25, 2008
Posts: 37
Hi Asif here are the configurations

Web.xml



struts-config.xml



Thanks
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

I think I found some configuration related issue

In the web.xml you have defined the servlet as follows



while in the strus-config.xml you have declared the action with the servlet as follows



So , to access the servlet , you have to use the name of the Action , Not the servlet name . Try changing it to this

ajay solanki
Ranch Hand

Joined: Feb 25, 2008
Posts: 37
Hi Asif, correct me if I am wrong,


here name is the name of form bean, not the name of action. Action always known by its path. So in that case my form tag seems right.

ajay solanki
Ranch Hand

Joined: Feb 25, 2008
Posts: 37
Please, does someone know the reason behind this issue?

Here I am posting the java file from JSP page.



As you can see my action is being set to the html form, but I have no idea why it show different in my browser.
Please, if someone has encountered this problem or know the solution, help me.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Html:form tag in struts 1.1