• 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

A basic problem

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which server are you using and did you restart it after the modifications ?
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh yes,
I am using NetBeans 4.1 and the server is Tomcat Apache.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you restart Tomcat after the modifications to web.xml ?
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, i restarted it.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you still have any reference to login.jsp in your web.xml ?
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No,
there is no reference to Login.jsp in the web.xml file.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another thing.
Do you have a default servlet running somewhere redirecting to login.jsp ?
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you are right. I'm working on that.

Thanks a lot,
Bitz.
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I f'got to ask u this :

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

Thanks,
Bitz
 
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

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
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
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
Thank you.
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Does anyone the answer to my question ?
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try after removing the tomcat cache, under TOMCAT_HOME/work. Although, it shouldn't be like that.
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I deleted the tldCache in the Tomcat_Home/work directory, but i'm getting the same result.
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Deleted. Useless post.]
[ February 23, 2006: Message edited by: Adeel Ansari ]
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the URL you are using to access the app?
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://localhost:8080/HackersBank
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, when i type http://localhost:8080/setup.jsp i get the right page and everything works fine.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh sorry,
it is http://localhost:8080/HackersBank/setup.jsp it works fine.

i'll change the name and try.
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The tomcat version is 5.5

and i changed the name to index.jsp but nothing happens.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to change or add welcome-file-list element in any other existing app in your webapp space.
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
bitz,

Are you sure you are not using any filters?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic