Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

url rewriting

 
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.
 
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 ]
 
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.
 
Bartender
Posts: 2856
10
Firefox Browser Fedora 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 .
 
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("");
 
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
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: 2856
10
Firefox Browser Fedora 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.
 
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic