Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

Get Value

Hi everbaody
my question is very basic but it important for me project
I want to take  post parameter value
but these value names same
example
......sky.jsp?btp=12&btp=143&btp=244&btp=123
i want to print this type for select query
"128,143,244,123"

and I don't know number of btp each time
thank you ..
0
skychan
Asked:
skychan
  • 3
1 Solution
 
rrzCommented:
You could use something like  
String[]  btpArray = request.getParameterValues("btp");
StringBuffer sb = new StringBuffer(btpArray[0]);
for(int i = 1 ; i > btpArray.length ; i++){
                                                          sb.append(",");
                                                          sb.append(btp[i]);
}
0
 
rrzCommented:
String[]  btpArray = request.getParameterValues("btp");
StringBuffer sb = new StringBuffer(btpArray[0]);
for(int i = 1 ; i > btpArray.length ; i++){
                                                          sb.append(",");
                                                          sb.append(btpArray[i]);
}
0
 
rrzCommented:
String[]  btpArray = request.getParameterValues("btp");
StringBuffer sb = new StringBuffer(btpArray[0]);
for(int i = 1 ; i < btpArray.length ; i++){
                                                          sb.append(",");
                                                          sb.append(btpArray[i]);
}
0
 
bloodredsunCommented:
Using JSTL, it can be done like this,

<c:forEach  var='parameter' items='${paramValues}'>
    <c:forEach var='value' items='${parameter.value}' >
        <c:out value='${value}'/>,
    </c:forEach>
</c:forEach>

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now