Meaningless Drivel is fun!*
The moose likes JSP and the fly likes On-the-Fly changing the layout in JSP or web page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "On-the-Fly changing the layout in JSP or web page" Watch "On-the-Fly changing the layout in JSP or web page" New topic
Author

On-the-Fly changing the layout in JSP or web page

Brahmananda Reddy Kakumanu
Greenhorn

Joined: Dec 07, 2005
Posts: 3
Hi All,

i have a requirement like changing the layout in webpage (JSP) on the fly.

layout switching should be done with out restarting the app server.

Thanks in advance.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

CSS?
Brahmananda Reddy Kakumanu
Greenhorn

Joined: Dec 07, 2005
Posts: 3
Not using java script or CSS. Should be done at server side and without redeploying or restarting the application server.
Sean Clark
Rancher

Joined: Jul 15, 2009
Posts: 377

Hey,

So you mean you want to remove the JSP's you have and put new ones in? How is this going to be started, does someone click a link or does it happen every 2 hours? Are you going to be changing the layout back and forward from one to the other?

To me, I agree with David, surely CSS would be the route to go down. I refuse to believe that your requirements say you must have say 10 different layouts for the same jsp page and you must do them all in seperate JSPs.

Sean

I love this place!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Brahmananda Reddy Kakumanu wrote:Not using java script or CSS. Should be done at server side and without redeploying or restarting the application server.

Ridiculous, and flies in the face of anything that makes sense.

Check out the CSS Zen Garden: all done with CSS. Doing it any other way is a waste of time.
Kakumanu Brahmananda Reddy
Greenhorn

Joined: Dec 07, 2005
Posts: 6
requirement is like whenever content (layout in JSP) changed in CMS should reflect the same for new users not of old users ( who are already accessing the page ).

1). User1 -- accessing -- www.abc.com -- viewing page in layout1
2). changed layout1 to layout2 in JSP (which is in CMS and published)
3). User2 -- accessing -- same www.abc.com -- should get layout2

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

CSS?
Kakumanu Brahmananda Reddy
Greenhorn

Joined: Dec 07, 2005
Posts: 6
Sean Clark wrote:Hey,

So you mean you want to remove the JSP's you have and put new ones in? How is this going to be started, does someone click a link or does it happen every 2 hours? Are you going to be changing the layout back and forward from one to the other?

Sean


hi clark, we are planning to move JSP's to CMS. so that we can change jsp's on the fly without restarting server. we can achieve this by using custom tag and including those JSP's (for this we need to create JSP's in war or ear file, but another hurdle is we shouldn't create JSP's in the filesystem ).
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You can *already* change JSPs on the fly without restarting the server. And JSP is a horrible standalone templating system, and difficult to make it in to such: FreeMarker, Velocity, etc. are all better choices for dynamic templates.

But you have yet to explain why CSS isn't a good choice.
Kakumanu Brahmananda Reddy
Greenhorn

Joined: Dec 07, 2005
Posts: 6
David Newton wrote:You can *already* change JSPs on the fly without restarting the server. And JSP is a horrible standalone templating system, and difficult to make it in to such: FreeMarker, Velocity, etc. are all better choices for dynamic templates.

But you have yet to explain why CSS isn't a good choice.


Hi david,

i do agree with you, using CSS we can handle this. But we shouldn't use js or css (according to client requirement).

how can we handle this in freemarker or velocity ???

thanks in advance.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The client requires you not to use CSS?
Kakumanu Brahmananda Reddy
Greenhorn

Joined: Dec 07, 2005
Posts: 6
David Newton wrote:The client requires you not to use CSS?


Yes :(
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What's their reasoning?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

That's like someone ordering a modern car, but saying not to use electronics. Ridiculous!

I understand that the client calls the shots because they have the money, but sometimes you need to push back on them a little when they make silly decisions based upon ignorance.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kakumanu Brahmananda Reddy
Greenhorn

Joined: Dec 07, 2005
Posts: 6
David Newton wrote:What's their reasoning?

i am not sure about their reasoning.
Kakumanu Brahmananda Reddy
Greenhorn

Joined: Dec 07, 2005
Posts: 6
Kakumanu Brahmananda Reddy wrote:
David Newton wrote:What's their reasoning?

i am not sure about their reasoning.


any work around?

Thanks in advance.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

You'll simply need to rejigger the HTML each time.
 
Don't get me started about those stupid light bulbs.
 
subject: On-the-Fly changing the layout in JSP or web page