my dog learned polymorphism
The moose likes Struts and the fly likes Html:form tag in struts 1.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Reply 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: 35
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: 35
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: 317

Hi ,

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

Change it to


Regards, Muhammad Saif Asif Mirza
SCJA(5/6) SCJP(6)
ajay solanki
Ranch Hand

Joined: Feb 25, 2008
Posts: 35
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: 317

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: 35
Hi Asif here are the configurations

Web.xml



struts-config.xml



Thanks
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 317

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: 35
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: 35
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Html:form tag in struts 1.1
 
Similar Threads
html:form question
using struts html:form without action attribute
struts 1.3.5 tags-html attributes syntax error
can i use a normal form with struts?
No getter method for property finame of bean org. apache. struts. taglib. html. BEAN