This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See welcome thread
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

static results in JSP pages  RSS feed

Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I am a new member of the group.I have to build an application using JSP.
I created the .JSP files and put them in the tomcat directory jsp-examples\mydirectory\..
also i created my file and put that at WEB-INF\classes directory.
Now the problem is when i called the TOMCAT i cud execute and link my JSP files with the
class java file.The deatils which i get for the 1st time remains for ever without getting
refreshed.even incase i change the contents of the .java file it doesn't change at all.
how to rectify it.please help.i have given the code for ur reference.

the codes are as follows

1) login.jsp

<FORM name="login" METHOD="POST" ACTION="Welcome.jsp">
Username:<INPUT name="id" type="text">
Password: <input name ="pwd" type="password">

2) Welcome.jsp

<%@ pageimport ="pj05t05.nata.*"%> //this is my package name
<meta http-equiv ="20" />
String id=request.getParameter("id");
String pwd=request.getParameter("pwd");
login l1=new login();
String name= l1.validate(id,pwd);



package pj05t05.nata;
public class login
public String validate(String id,String pwd)

String s1,s2;
if( s1.equals("id") & s2.equals("pwd"))
return "nata";
return "here";

this is my probs as i need to know the fix it ASAP please help me out.
Thanking you in advance,
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if this is the problem you are talking about, but the login.validate() method is wrong - the existing code will *always* return the String "here" because it tests the String "t05" against the String "id" - *NOT* the value held in the String variable id - the actual String literal "id". The same problem exists with pwd. Leave the quotes off both id and pwd in the equals statements.
Author and ninkuma
Posts: 66425
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It also sounds like you may be expecting your .java files to automatically get recompiled when you change them. If this impression is correct, be advised that you must compile changes to your java files and be sure that their class files end up in the right place.

Also, natarajan, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

JSP Forum Bartender
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!