Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Customize Login Page Based on Url in J2ee Application

 
Arulanand Dayalan
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to customize pages in an J2ee web application(Struts) so that it can support different products. Example of customization - Different look and feel(Images/Css) , Hide columns and different Login pages based on the products. When the user types in http://localhost:9080/TestApp/ProductA then customized login page for ProductA should appear. Once the user logins then all the pages need to be customized for ProductA. This customization can be done if we identify the product. The problem i am facing is how to identify the product based on the URL.

When the user types in http://localhost:9080/TestApp/ProductA i need find out its for ProductA then forward to login JSP. In that jsp i can have hidden variable with product as ProdctA.After this its not problem. Is there any way to do it?

Thanks in Advance.

Regards,
Arul.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, so far what you are tried?
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what you are actually looking to do is to load a different CSS depending on what url was accessed then?
It's possible.

Sean
 
Arulanand Dayalan
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sean Clark wrote:So what you are actually looking to do is to load a different CSS depending on what url was accessed then?
It's possible.

Sean


Loading different CSS is possible and i am able to do that. In my welcome pagelist i have login.jsp. The problem i am facing is, identifying ProductA from the url and setting it in the request before passing to login.jsp. I thought of using filter, but don't know how to get the ProductA in the filter.

For applying CSS i can do like this, src="css/"+<%= product >+"/style.css"

Regards,
Arul.
 
krishna bala
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ciao

create table in DB like product_info with the fields like product_id , product_name , product_xml


product.xml contains information about css, logo , menu etc.
get the product name from request then
in filter you will get the xml from DB by passing product name , send required information to jsp .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic