How to write label in jsp?

Hi

I need to display a string value get from a parameter in a jsp page.

http://www.test.com/index.jsp?message=Welcome

How to display 'Welcome' in the jsp page? is it some kind like asp's label?
<%
if(request.getParameter("message")!=null){
String message = request.getParameter("message");
System.out.println(message); //how can i print it on a jsp page?
}
%>

Open in new window

techquesAsked:
Who is Participating?
 
KuldeepchaturvediCommented:
you need to change

System.out.println(msg);

to
out.println(msg);

System.out is console

out is the printwriter back to jsp
0
 
KuldeepchaturvediCommented:
<%
if(request.getParameter("message")!=null){
String message = request.getParameter("message");
out.println(message); //how can i print it on a jsp page?
}
%>

will put it on jsp page.
0
 
techquesAuthor Commented:
yes, I put it in jsp page already, but still cannot display
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
KuldeepchaturvediCommented:
the code above shd def show it on your web page..

if your jsp have nothing else but just this code...
it should display Welcome on the page...
0
 
techquesAuthor Commented:
Yes, there is something else in the jsp page.

But, when the url returns
http://localhost:8080/test/index.jsp?msg=Welcome

The page does not display 'Welcome'.
Welcome display in console windows in eclipse.
<form name="loginjsp" action="login" method="post">
Email: <input type="text" name="email"><br>
Password: <input type="password" name="password"><br>
<input type="submit" name="Button" value="Login">
<%
if(request.getParameter("msg")!=null){
String msg = request.getParameter("msg");
System.out.println(msg);
}
%>
</form>

Open in new window

0
 
techquesAuthor Commented:
oh, sorry for my fault. I am a very newbie to jsp.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.