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

x
?
Solved

unidentified request object

Posted on 2003-03-16
2
Medium Priority
?
183 Views
Last Modified: 2010-04-01
Just learning to do JSP and I do the following page:

<html>
   <head>
      <title>JSP Programming Sample</title>
  </head>
  <body>
    <%! String first = request.getParameter("fname");
        String last = request.getParameter("lname");
       %>
    <p>Your first name is <%=first%> </p>
    <p>Your last name is <%=last%> </p>
   </body>
</html>

When I point my browser to the page and supplying parameter for "fname" and "lname", Tomcat 4 complains that "request" is undefined class or variable. Does it mean that I don't get the "request" object on a doGet by the browser or I've missed something here ?
0
Comment
Question by:ttung11
  • 2
2 Comments
 
LVL 3

Expert Comment

by:allahabad
ID: 8149483
<html>
  <head>
     <title>JSP Programming Sample</title>
 </head>
 <body>
   <% String first = request.getParameter("fname");
       String last = request.getParameter("lname");
      %>
   <p>Your first name is <%=first%> </p>
   <p>Your last name is <%=last%> </p>
  </body>
</html>
0
 
LVL 3

Accepted Solution

by:
allahabad earned 200 total points
ID: 8149498
Code under <%! %> is class level variable, so it will load first for initialization, at that time request object is not available; you will get error.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

How does storytelling impact the web? What goes into a great story on the web? And how can it be used for marketing purposes? All of these questions will be answered.
How do you create a user-centered user experience on your website? And what are some things you should consider in the process?
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month13 days, 5 hours left to enroll

578 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