• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Modified Code Barn Simple MVC not works

 
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,

I copied the Code Barn SimpleMVC.war file and paste it to tomcat\web-apps\ and it works fine... Then i made some changes with the program and create a WAR file and paste it to webapps folder.. but now it shows error that

HTTP Status 404 - /SimpleMVC/

--------------------------------------------------------------------------------

type Status report

message /SimpleMVC/

description The requested resource (/SimpleMVC/) is not available.


--------------------------------------------------------------------------------

Apache Tomcat/6.0.16

Here is the modified code
--------------------------
ControllerServlet.java


ModelBean.java


view.jsp




What is the problem.. did i do any mistake? please help me get rid of this..
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If Tomcat says it is unavailable, you may want to check your DD. That seems to be the most common fix for this issue.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're not following the Javabean coding conventions (which is necessary for use with EL).

If you have a property named "thing", the setter should be spelled "setThing" and the getter should be spelled "getThing". Notice the capital "T".

When you use the EL expression ${modelBean.thing}, the JSP engine is going to add the "get" and capitalize the first letter, turning it into "getThing". Since Java is case sensitive, a method named getthing would not match.
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now i change the username to UserName.. all works fine it executes and displays the login page but when i click the submit button it shows an error like this...


HTTP Status 500 -

org.apache.jasper.JasperException: An exception occurred processing JSP page /view.jsp at line 16

13: <td>
14: <input type="text"
15: name="username"
16: value="${modelBean.UserName}" />
17: </td>
18: </tr>
19: <tr>




But i have changed the username to UserName but still it troubles me... what should i do now?

Help me regards this...
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are still not following the JavaBean rules that Ben outlined.
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mr.Bear Bibeault could you please tell me whats wrong with my EL. Because i dont know much about EL. Even though i changed message to Message it doesnt seems to be work. Can you spot my mistake and give me the answer. Please help me as i am a beginner. Thanks in advance
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should be "userName", not "UserName". The Java class then needs to have methods called setUserName and getUserName.

I think it would be helpful for you to go through an introduction to JSP; you might start with this free book.
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mr.Ulf Dittmer
Now i got a clear idea on EL and modify the program again.. yes it's working. The online free ebook is very helpful to understand JSP and Servlet concept for a beginner like me.. Anyway thanks for everybody helps regrding this problem.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic