Link to home
Start Free TrialLog in
Avatar of techques
techques

asked on

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

Avatar of Kuldeepchaturvedi
Kuldeepchaturvedi
Flag of United States of America image

<%
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.
Avatar of techques
techques

ASKER

yes, I put it in jsp page already, but still cannot display
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...
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

ASKER CERTIFIED SOLUTION
Avatar of Kuldeepchaturvedi
Kuldeepchaturvedi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
oh, sorry for my fault. I am a very newbie to jsp.