• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic