Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

url rewriting

 
chinmaya kumar mishra
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
chinmaya kumar mishra
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Jetendra Ivaturi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check your private messages.

As suggested by one, its good to use encodingURL("");
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jetendra Ivaturi, please read this.
 
Jetendra Ivaturi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Soroj,

What do you mean
when client browser is block ?

Thanks.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic