Solved

Multiple params with html:link tag

Posted on 2006-10-22
4
198 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
immutable object concept 5 134
sortaSum challenge java 17 174
nested if has else if 13 99
HTTPSessionBindingListernter not configured in deployment descriptor 2 70
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Building a cohesive image for your brand is vital to making an impression on consumers. When the economy is tough, brands do better than unbranded  products. This can have a huge impact on your long-term profits, as the economy goes up and down.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 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