• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Tomcat with more than one Applications in WEBAPPS folder

 
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i have an application in the tomcat webapps folder which authorises using FORM based Authentication and i added the username and roles in the tomcat-users.xml file and the container authenticates and authorises the user logged in. Now i am adding another application in the webapps folder which works using JDBC realm where i created tables containig username and password and roles in oracle database, after i configure my server.xml file so that the new application uses these tables to authenticate and authorise users , will this effect my old application how will the container recognise this new application is to be work using JDBC realm and the old one to work with memory realm?
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Tomcat docs indicate that it is possible to set up realms per context (by nesting the Realm element inside of the Context element). Have you tried that?

(Note that the default configuration of server.xml has a Realm element inside the Engine element, which will cause all web apps to use the same Realm; you'll need to change that.)
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed my server.xml and added the realm in the context element under the engine element



My Application URL is http://localhost:8080/BillingSystem


and in the web.xml i added





And my login.html contains



Now when i click the login button without providing the username and password the control does not goes to the error.html file ... Also i want to know that the configuration of the realm for the context is correct or i am missing out something.

 
Saloon Keeper
Posts: 22503
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My login/loginfail pages are JSPs, not HTML.
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But in the other application i used it as html and it worked fine....
 
Tim Holloway
Saloon Keeper
Posts: 22503
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the other thing I do is define the realm in each context. A quick re-read of your initial message gives me the impression that you're activating 2 different realms at the server engine level and expecting magic to connect the right webapp to the right realm. There isn't any magic, so you'd need to define the realm for the context of the webapp rather than in server.xml.
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
define the realm for the context of the webapp rather than in server.xml.



How do i do this stuffing the Context element in the Engine element and giving the path of the application is not enough where am i breaking the link?

 
Tim Holloway
Saloon Keeper
Posts: 22503
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This is all there is. Nothing in server.xml, nothing under Engine. I just put this file under the name TOMCAT_HOME/conf/Catalina/localhost/jtaonthemove.xml
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application name is BillingSystem and it is under

C:\Tomcat 5.5\webapps\BillingSystem

Now i created a file called BillingSystem.xml and its path is C:\Tomcat 5.5\conf\catalina\localhost\BillingSystem.xml

Now can you please tell me what values should Context path,docbase and Resource name should contain

the file BillingSystem.xml contains


 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Context element with realm placed inside Engine element in server.xml file should work i dont no where am i doing wrong
 
Doe, a deer, a female deer. Ray, a pockeful of sun. Me, a name, I call my tiny ad ...
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic