• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts and JSP

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Im a newbie to struts. Em invoking multiple executable methods from JSP to struts action but My action class is showing nothing
Here is My JSP Code

This is My Simple Action FormBean


This is My ActionClass

Thanks in Advance....!
 
Greenhorn
Posts: 26
MySQL Database Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Modify your code like this....


<html:form action="/multi">
<bean:write name="Message" property="message"/>
<html:submit property="Method" value="add" onclick="doAdd();" />
<html:submit property="Method" value="update" onclick="doUpdate();" />
<html:submit value="delete" property="Method" onclick="doDelete();"/>
</html:form>
<script>
function doAdd()
{
var url = "<%=request.getContextPath()%>/add.do?dispatchMethod=add";
var thisForm = document.forms[0];
thisForm.action = url;
thisForm.submit();
}
function doDelete()
{
var url = "<%=request.getContextPath()%>/delete.do?dispatchMethod=delete";
var thisForm = document.forms[0];
thisForm.action = url;
thisForm.submit();
}
function doUpdate()
{
var url = "<%=request.getContextPath()%>/update.do?dispatchMethod=update";
var thisForm = document.forms[0];
thisForm.action = url;
thisForm.submit();
}

</script>
 
khadar valli
Greenhorn
Posts: 26
MySQL Database Tomcat Server Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and also include the action methods in struts-config.xml...
 
Amarnath Joshi
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You Valli.. for your reply.

Actually we don't need any script to execute these methods and My mistake was in XML I didn't specify any parameter for my property Attribute in XML. And the issue is fixed.
Thank You.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic