How do I call a servlet with parameters in the URL?
Submitted by: AdministratorThe usual format of a servlet parameter is a name=value pair that comes after a question-mark (?) at the end of the URL. To access these parameters, call the getParameter() method on the HttpServletRequest object, then write code to test the strings. For example, if your URL parameters are "func=topic," where your URL appears as:
http://www.myserver.com/myservlet?func=topic
then you could parse the parameter as follows, where "req" is the HttpServletRequest object:
String func = req.getParameter("func");
if (func.equalsIgnoreCase("topic")) {
. . . do some work
}
Submitted by: Administrator
http://www.myserver.com/myservlet?func=topic
then you could parse the parameter as follows, where "req" is the HttpServletRequest object:
String func = req.getParameter("func");
if (func.equalsIgnoreCase("topic")) {
. . . do some work
}
Submitted by: Administrator
Read Online BEA Weblogic Job Interview Questions And Answers
Top BEA Weblogic Questions
☺ | Can I use the getAttribute() and setAttribute() methods of Version 2.2 of the Java Servlet API to parse XML documents? |
☺ | Which of the following are the benefits of MDB (Message Driven Beans) over standard JMS consumers? |
☺ | Why do I get an error while trying to retrieve the text for ORA-12705? |
☺ | Why am I getting an ORA-01000: maximum open cursors exceeded error, even though I closed all ResultSet, Statement, and Connection objects? |
☺ | Can WebLogic Server start with a UNIX boot? |
Top Application Program Categories
☺ | AutoCAD Interview Questions. |
☺ | Microsoft Office Interview Questions. |
☺ | Microsoft Outlook Interview Questions. |
☺ | Microsoft Excel Interview Questions. |
☺ | MATLAB Interview Questions. |