• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

struts form

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hava a form which does is doing two posts every time I click the submit button. Why would this happen?
 
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My guess is that the action is mapped to itself in struts.xml
 
Keith Lockey
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<action name="CreateWorkFlowItemBean" path="/createworkflow" scope="session" type="com.unitrin.paws.action.CreateWorkFlowItemAction" validate="false">
<forward name="CreateWorkFlowItemJsp"path="/jsp/CreateWorkFlowItem.jsp" />
</action>
I don't have it mapped to itself.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can your post the JSP form code and submit button code?
 
Keith Lockey
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the java script onLoad attribute is making it load additionally to the form submit.
So now instead of using javascript i need to figure out how to put the a collection in my bean so it will show up in the select options tag, maybe you can point me towards this?
 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
u could use jstl like this
<c:set var="speclist" value="${applicationScope.profileCache.professionSpecialtyListMap}"/>
<c:forEach var="entry" items="${speclist}">
<c:if test='${entry.key == prof}'>
<select name="specialty" class="text10">
<option value="">---------- Select One ----------</option>
<c:forEach var="specialty" items="${entry.value}">
<c:set var="specid" value="${specialty.specialtyID}"/>
<c:set var="name" value="${specialty.description}"/>
<option value="<c ut value="${specid}"/>" <c:if test='${specid == spec}'> selected </c:if> ><c ut value="${name}"/></option>
</c:forEach>
</select>
</c:if>
</c:forEach>
and java script should be fine but why would it cause the form to submit unless u are using an html:img tag........i had a problem when i was using html:img buttons initially coz i was accidentally calling the form on the click of the image.............make sure that its not the same thing....
 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic