Results 1 to 1 of 1
Thread: Finding arguments of Servlet
-
Finding arguments of Servlet
Sometimes, you want to find the number of arguments that a Servlet got and then want to proceed accordingly. Review the code below:
Java Code:int i = req.getParameterMap().size(); if (i = 0) { // no arguments } else { Enumeration paramNames = req.getParameterNames(); while(paramNames.hasMoreElements()) { String parm = (String)paramNames.nextElement(); // do something with this parm } }
Similar Threads
-
Arguments in Main
By CyberFrog in forum New To JavaReplies: 2Last Post: 03-30-2008, 09:37 PM -
repetition of 'arguments'(?)
By Igor in forum New To JavaReplies: 3Last Post: 12-13-2007, 10:08 AM -
Printing command line arguments
By Java Tip in forum Java TipReplies: 0Last Post: 12-03-2007, 09:27 AM -
Variable No. of Arguments
By Gajesh Tripathi in forum New To JavaReplies: 2Last Post: 10-31-2007, 02:50 PM -
javax.servlet.ServletException: Wrapper cannot find servlet class util.t2
By osval in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 03:47 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks