• 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

link without actionform

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am using this tag on test.jsp

<html:link action="/getRecord" ><html:img alt="raman" action="/getRecord"></html:img></html:link>

when i click the image
i want to runthe /getRecord action and get resultset from action into the session
and i wanna use the result set to see the list but i am not getting the result


Action file is :----------------->


public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response, PreparedStatement ps)
throws Exception {
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
DataSource dataSource = null;
try {
dataSource = getDataSource(request);
conn = dataSource.getConnection();
PreparedStatement pst = conn.prepareStatement("SELECT * FROM coordresume");
rs = pst.executeQuery();
HttpSession session=request.getSession();
session.setAttribute("result",rs);
} catch (Exception ex) {
}
return mapping.findForward(SUCCESS);
}




webconfig--------------------------------->

<action path="/getRecord" type="submit.resume.getRecordAction" >
<forward name="success" path="/viewResume.jsp" />
</action>



viewResume.jsp---------------->

<logic:notEmpty property="result">
<TR class="bodytext" vAlign="top" height="25">
<TD class="tableheader" align="center" width="35%" bgColor="#cccc99"></TD>
<TD width="35%" bgColor="#ebebe1"></TD>
<TD width="10%" bgColor="#ebebe1"></TD>
<TD width="10%" bgColor="#ebebe1"></TD>
<TD width="10%" bgColor="#ebebe1"> </TD>
</TR>
</logic:notEmpty>
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What version of Struts are you using? Note that the action attribute of the html:img tag does not specify the action to execute when you click the button. Here is the description:

action The action, starting with a slash, that will render the image to be displayed by this tag.

- Brent
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

Originally posted by ramandeep singh:
<html:link action="/getRecord" ><html:img alt="raman" action="/getRecord"></html:img></html:link>



no need to write action in both tag. remove action from img tag.

milan.
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic