• Post Reply Bookmark Topic Watch Topic
  • New Topic

${parm.userName} not printing anything in <c:out

 
Prashant Hurria
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am using Tomcat 4.1.39 and JSTL and JSTL 1.0.6
Was just trying a tutorial in a Book and it just didnt work here is what I did:-
Created a Form in \webapps\struts\Jstl\userForm.jsp
as follows

<form action="display.jsp">
UserName:<input type="text" name="userName"/>
<br/>
Password:<input type="password" name="password"/>
<br/>
Age:<input type="text" name="age"/>
<br/>
<input type="submit"/>
</form>


Then created another page \webapps\struts\Jstl\display.jsp
as follows
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<%= request.getParameter("userName")
%>
Hi The User name is = <c:out value="${parm.userName}" />
<br/>
Password is = <c:out value="${parm.password}" default="error"/>
<br/>
Age is =<c:out value="${parm.age}" default="error"/>


Now the problem is <%= request.getParameter("userName")
%> is displaying the username correctly but <c:out value="${parm.userName}" /> is not.
I think I am making a stupid mistake. Please advise.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's "param", not "parm".
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And please use code tags, not red text.
 
Anurag Blore
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Please use Eclipse or some IDE to avoid syntax issues.
 
Prashant Hurria
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a Lot for your Quick reply.
I know the Question was stupid.I should have rechecked.
About using IDE's I prefer using it for work but for self learning i prefer the good old notepad you tend to learn a lot more.
JAVA Ranch is a Great Forum.Thanks All.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!