Solved

Multiple params with html:link tag

Posted on 2006-10-22
4
201 Views
Last Modified: 2010-04-01
Hi,
In struts , how to pass a argument dynamically using the html:link and how to get that variable in the action class?

Regards
HK
0
Comment
Question by:harishkg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Author Comment

by:harishkg
ID: 17786774
<html:form action="/editClient">
<%
      ArrayList<Client> clientList = null;
      Object obj = request.getSession().getAttribute(LabelResources.CLIENTS.getMessage());
      if(obj instanceof ArrayList){
            clientList = (ArrayList<Client>)obj;
      }
      Iterator<Client> iter = clientList.iterator();
%>
                                                
<%
      long x;
      while(iter.hasNext()){
            Client client = iter.next();
            x=client.getId();
      %>
<TR>
<TD>
<!-- < html : option value="< % =client.getName()% > "> -->
<%=client.getName()%>
<!--  < / html : option> -->
</TD>
<TD>
<html:link action="/editClient?methodName=edit">edit</html:link>
</TD>

Like, how should I pass the clientID to the action in the above <html:link ??
0
 
LVL 4

Expert Comment

by:Tol_cv
ID: 17786811
in jsp:

<html:link action="/editClient?methodName=edit"  paramId="clientlId" paramName="client" paramProperty="id">

in your action:
<yourformbean>.getClientId();

 of course that means that your form has a property  clientId in it
0
 

Author Comment

by:harishkg
ID: 17786848
I used this
<html:link action="/editClient?methodName=edit"  paramId="clientId" paramName="client" paramProperty="id">edit</html:link>

org.apache.jasper.JasperException: Exception in JSP: /admin/icf/icf_list_client.jsp:50
this is the exception I got:

47:                                                       </TD>
48:                                                       <TD>
49:
50:                                                                    <html:link action="/editClient?methodName=edit"  paramId="clientId" paramName="client" paramProperty="id">edit</html:link>
51:                                                       </TD>
52:                                                 </TR>
53:                                           <%

root cause:
 javax.servlet.ServletException: Cannot find bean: "client" in any scope

0
 
LVL 4

Accepted Solution

by:
Tol_cv earned 50 total points
ID: 17788205
sorry i assumed you have a client bean in your jsp

<html:link page='"/editClient?methodName=edit&clientlId="+<%=client.getId()%>' />
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
getting param value 7 62
Set up Wildfly 10 8 471
JavaScript parse form with colon separated values 2 79
Why my table column Id is not passed to java object? 4 46
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question