my dog learned polymorphism*
The moose likes Servlets and the fly likes url rewriting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "url rewriting" Watch "url rewriting" New topic
Author

url rewriting

chinmaya kumar mishra
Greenhorn

Joined: Jul 06, 2008
Posts: 4
can any body show me the code in case of url rewiting session management.

if my scenarion is
first servlet i want to select 2 data
second servlet i want to add 2 more data to that same data
then in third servlet i want to retrieve all the four data.
what will be the code if i want to use url rewriting as session management.

show me all the servlet code.
Siddharth Naik
Ranch Hand

Joined: Apr 09, 2006
Posts: 35
URL rewriting is used while sending response and not while setting session attributes. So set and get session attributes as usual and call encodeURL method on response object.



Thanks<br />Sid
chinmaya kumar mishra
Greenhorn

Joined: Jul 06, 2008
Posts: 4
Originally posted by Siddharth Naik:
URL rewriting is used while sending response and not while setting session attributes. So set and get session attributes as usual and call encodeURL method on response object.




hi

as it is used for sendind resonse. then why it is called one type of serverside session management.
Siddharth Naik
Ranch Hand

Joined: Apr 09, 2006
Posts: 35
Because URL rewriting doesn't use client side cookies.

[ July 07, 2008: Message edited by: Siddharth Naik ]
[ July 07, 2008: Message edited by: Siddharth Naik ]
Soroj Margun
Ranch Hand

Joined: Jun 15, 2008
Posts: 44
Hi all ,

URL rewriting is only used when client browser is block or not support cookie. Because client need to send back a session ID to identified itself and link with session object on the server side. If cookie is disabled, you must use URL rewriting technic to maintain this relationship.

Hope this help.


SCJP 1.2; SCWCD 1.2,1.4; SCBCD 1.3; SCJD 5.0
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Hi chinmaya kumar mishra welcome to Javaranch,
what will be the code if i want to use url rewriting as session management.

show me all the servlet code.

First things first DoYourOwnHomework dont ask the forum to write code for you.
And please take some time to read the Ask Good Questions link below and the beginners faq.

Hope this helps .


SCJP, SCWCD.
|Asking Good Questions|
Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159
Check your private messages.

As suggested by one, its good to use encodingURL("");


SCJP 1.4 & 1.5, SCWCD 1.5. Learn and Let Learn.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60776
    
  65

Jetendra Ivaturi, please read this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159
I regret for my behavior, its not being selfish by the way.

As I dont want to burden the server by putting all the programmes, wanted to share it individually.

Any ways I admit my mistake, will not do this again.

Thanks.
sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
Soroj,

What do you mean
when client browser is block ?

Thanks.
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Originally posted by Soroj
URL rewriting is only used when client browser is block or not support cookie


It only means the browser has blocked cookies or does not accept them.
 
Don't get me started about those stupid light bulbs.
 
subject: url rewriting
 
Similar Threads
URL rewriting
most challenging topics in SCWCD
How can we send data from one jsp page to another jsp page
Default session management
session management -cookie disabled