aspose file tools*
The moose likes JSP and the fly likes A basic problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "A basic problem" Watch "A basic problem" New topic
Author

A basic problem

S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Hi,
In the web.xml of my project, earlier i had set the < welcome-file > to Login.jsp

but now after some design changes, the first page the user gets has to be a setup.jsp.
so i changed the welcome file to setup.jsp but when i run the application, the first page is still login.jsp !

Could anyone tell me why this is happening and what could be the solution for this?

Thanks,
Bitz.
[ February 23, 2006: Message edited by: Bear Bibeault ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Which server are you using and did you restart it after the modifications ?


[My Blog]
All roads lead to JavaRanch
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Oh yes,
I am using NetBeans 4.1 and the server is Tomcat Apache.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Did you restart Tomcat after the modifications to web.xml ?
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Yes, i restarted it.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Do you still have any reference to login.jsp in your web.xml ?
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
No,
there is no reference to Login.jsp in the web.xml file.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Strange, it works for me without restarting Tomcat (version 5.5).
Which version are you using ?
And could you please post your <welcome-file-list> ?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Another thing.
Do you have a default servlet running somewhere redirecting to login.jsp ?
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
This is my welcome-file list,

<welcome-file-list>
<welcome-file>
setup.jsp
</welcome-file>
</welcome-file-list>


and i have to check the default servlet thing.

Thanks,
Bitz
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Your welcome file is ok, so I guess you are redirecting to login.jsp from a default servlet, using a RequestDispatcher.
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
I think you are right. I'm working on that.

Thanks a lot,
Bitz.
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
I f'got to ask u this :

Well actually which one would be a default servlet in an application?

Thanks,
Bitz
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60991
    
  65

Originally posted by S bitz:
I f'got to ask u this :


"S bitz", 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.

Please read this for more information.

thanks,
bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Oh i'm sorry about that. That was an unintentional mistake, but i will keep this in mind in my future posts.

Thanks,
Bitz.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60991
    
  65

Thank you.
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Hi,

Does anyone the answer to my question ?
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by S bitz:
Well actually which one would be a default servlet in an application?


Default servlet can be the one which would take all the regular requests. Its totally depends on you to choose which one would be the default servlet.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
If its still not working then you are welcome to post the web.xml complete entries and the code of setup.jsp.
[ February 23, 2006: Message edited by: Adeel Ansari ]
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Hi Adeel,
Well i haven't defined any default servlet, so i don't understand where the Login.jsp is being called from.I am posting the complete web.xml.



Thanks,
Bitz
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
I am seeing that you didn't put your servlets in any package. Please put all your classes in respective packages.

Moreover, you can just make a simple , hello world, login.html page and define it in your welcome list tag. Then try it out. If it comes to show that, it means there must be some problem in your login.jsp code.
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Hi Adeel,
I think i still have to learn a lot of things.But thanks for pointing out.
And yes i tried changing the <welcome-file> to another jsp and html pages, but still there is no effect.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Try after removing the tomcat cache, under TOMCAT_HOME/work. Although, it shouldn't be like that.
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Hi,
I deleted the tldCache in the Tomcat_Home/work directory, but i'm getting the same result.
Heonkoo Lee
Ranch Hand

Joined: Feb 10, 2005
Posts: 85
I think you probably have a login-config element declared in web.xml and login page set to login.jsp if it is the first page showing up for the user who is not yet logged in.

Are you sure your web.xml does not have security-constraint and login-config section?
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Hi,
I have posted the complete web.xml. Is this the one you are talking about or any other? And how would i find the security constraints? i have no idea about it.

Thanks,
Bitz
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
[Deleted. Useless post.]
[ February 23, 2006: Message edited by: Adeel Ansari ]
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Where do i make the changes? Actually you could say that i am a newbie, so if you could be a bit more explicit in explaining it,i might be able to solve the problem i've been facing since the past few days.

Thanks,
Bitz
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
What is the URL you are using to access the app?
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
http://localhost:8080/HackersBank
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by S bitz:
http://localhost:8080/HackersBank


Its really a wiered problem. The URL is looking fine to me.

Ok, when you access the page with the below
http://localhost:8080/HackersBank/setup.jsp

Are you getting the right page?
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Yes, when i type http://localhost:8080/setup.jsp i get the right page and everything works fine.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
You didn't tell the tomcat version. Which version are you using?
And try after changing the name of setup.jsp to index.html.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by S bitz:
Yes, when i type http://localhost:8080/setup.jsp i get the right page and everything works fine.


Excuse me!

http://localhost:8080/setup.jsp
or
http://localhost:8080/HackersBank/setup.jsp
??

It should be http://localhost:8080/HackersBank/setup.jsp
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Oh sorry,
it is http://localhost:8080/HackersBank/setup.jsp it works fine.

i'll change the name and try.
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
The tomcat version is 5.5

and i changed the name to index.jsp but nothing happens.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Try to change or add welcome-file-list element in any other existing app in your webapp space.
S bitz
Ranch Hand

Joined: Jan 20, 2006
Posts: 80
Well i did try doing that in other files in the web apps and its working fine.I dunno why its happening just in this application.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by S bitz:
Well i did try doing that in other files in the web apps and its working fine.I dunno why its happening just in this application.


Thats it. Now just replace your web.xml, bad one, with some other web.xml present in some other webapp. Then over-write the contents from servlet-name element to welcome-file-list element. Be sure dont over-write the web-app, root element, element.

OR

Just replace your web-app element, root element, with the web-app element in other applications Deplyment Descriptor(web.xml).

Are you getting me. Just try it out. It should work.
Tauri Valor
Ranch Hand

Joined: Aug 03, 2005
Posts: 166
bitz,

Are you sure you are not using any filters?


A Moment's insight is sometimes worth a Life's experience.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A basic problem