Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to indentify context root of url?

Reply
Thread Tools

How to indentify context root of url?

 
 
jlc488
Guest
Posts: n/a
 
      12-05-2009
I have a system which makes url connection to a remote server.

The thing is this method receive a url and make http connection to a
remote server.

And I need to differentiate each urls due to session management
problem.

I am using cookies to manage session and if I have a given url of
http://www.test.com/a or http://www.test.com/b.

These two urls have different context root wich is a and b However,
this domain-cookie reconize as only one.

Client side(the one receives the urls) is running on embeded machine
and compatible with only JDK 1.3

So, this is my questions, How am I suppose to solve this matter?

Any suggestions or ideas would be really appreciated.

Thanks in advance.

 
Reply With Quote
 
 
 
 
markspace
Guest
Posts: n/a
 
      12-05-2009
jlc488 wrote:

> I am using cookies to manage session and if I have a given url of
> http://www.test.com/a or http://www.test.com/b.
>
> These two urls have different context root wich is a and b However,
> this domain-cookie reconize as only one.



Can you explain what you mean by "context root" in this part?

Because I think you mean one thing, but something else keeps coming up
on Google when I take a look. Cookies only see the URL -- they don't
know anything about how your JEE app is configured. So that's my
question: Are you talking about a JEE context root, or something else?
And if so what?
 
Reply With Quote
 
 
 
 
jlc488
Guest
Posts: n/a
 
      12-08-2009
On Dec 6, 1:50*am, markspace <(E-Mail Removed)> wrote:
> jlc488wrote:
> > I am using cookies to manage session and if I have a given url of
> >http://www.test.com/aorhttp://www.test.com/b.

>
> > These two urls have different context root wich is a and b However,
> > this domain-cookie reconize as only one.

>
> Can you explain what you mean by "context root" in this part?
>
> Because I think you mean one thing, but something else keeps coming up
> on Google when I take a look. *Cookies only see the URL -- they don't
> know anything about how your JEE app is configured. *So that's my
> question: *Are you talking about a JEE context root, or something else?
> * And if so what?


Yes, you are right about cookies. Cookies only have information of
domain address.

But the problem for me is that I need to distinguish each root path
from the given url address.

Let's say, http://localhost:8080/prj1/ <-- this is one context root
named prj1.

It means there is a project on eclipse named prj1.

http://localhost:8080/ <-- this one has a context root of /.

http://localhost:8080 & http://localhost:8080/prj1, they are different
project or web sites.

So, This is my questions. How am I suppose to distinguish those two
projects? If I use cookies, it will consider those two as same.

I hope my explanation helps.

Thanking you


 
Reply With Quote
 
Jeffrey H. Coffield
Guest
Posts: n/a
 
      12-08-2009


jlc488 wrote:
> On Dec 6, 1:50 am, markspace <(E-Mail Removed)> wrote:
>> jlc488wrote:
>>> I am using cookies to manage session and if I have a given url of
>>> http://www.test.com/aorhttp://www.test.com/b.
>>> These two urls have different context root wich is a and b However,
>>> this domain-cookie reconize as only one.

>> Can you explain what you mean by "context root" in this part?
>>
>> Because I think you mean one thing, but something else keeps coming up
>> on Google when I take a look. Cookies only see the URL -- they don't
>> know anything about how your JEE app is configured. So that's my
>> question: Are you talking about a JEE context root, or something else?
>> And if so what?

>
> Yes, you are right about cookies. Cookies only have information of
> domain address.
>
> But the problem for me is that I need to distinguish each root path
> from the given url address.
>
> Let's say, http://localhost:8080/prj1/ <-- this is one context root
> named prj1.
>
> It means there is a project on eclipse named prj1.
>
> http://localhost:8080/ <-- this one has a context root of /.
>
> http://localhost:8080 & http://localhost:8080/prj1, they are different
> project or web sites.
>
> So, This is my questions. How am I suppose to distinguish those two
> projects? If I use cookies, it will consider those two as same.
>
> I hope my explanation helps.
>
> Thanking you
>
>

Unless I totally misunderstand your question (which happens) see

http://www.quirksmode.org/js/cookies.html

Cookies have a "path" as well as a "domain" so you can set different
cookies for www.xyz.com/a and www.xyz.com/b by setting the path to "/a"
or "/b"

Jeff Coffield
www.digitalsynergyinc.com
www.keepmeuptodate.net
 
Reply With Quote
 
jlc488
Guest
Posts: n/a
 
      12-14-2009
On Dec 8, 3:26*pm, "Jeffrey H. Coffield"
<(E-Mail Removed)> wrote:
> jlc488wrote:
> > On Dec 6, 1:50 am, markspace <(E-Mail Removed)> wrote:
> >> jlc488wrote:
> >>> I am using cookies to manage session and if I have a given url of
> >>>http://www.test.com/aorhttp://www.test.com/b.
> >>> These two urls have different context root wich is a and b However,
> >>> this domain-cookie reconize as only one.
> >> Can you explain what you mean by "context root" in this part?

>
> >> Because I think you mean one thing, but something else keeps coming up
> >> on Google when I take a look. *Cookies only see the URL -- they don't
> >> know anything about how your JEE app is configured. *So that's my
> >> question: *Are you talking about a JEE context root, or something else?
> >> * And if so what?

>
> > Yes, you are right about cookies. Cookies only have information of
> > domain address.

>
> > But the problem for me is that I need to distinguish each root path
> > from the given url address.

>
> > Let's say,http://localhost:8080/prj1/<-- this is one context root
> > named prj1.

>
> > It means there is a project on eclipse named prj1.

>
> >http://localhost:8080/<-- this one has a context root of /.

>
> >http://localhost:8080&http://localhost:8080/prj1, they are different
> > project or web sites.

>
> > So, This is my questions. How am I suppose to distinguish those two
> > projects? If I use cookies, it will consider those two as same.

>
> > I hope my explanation helps.

>
> > Thanking you

>
> Unless I totally misunderstand your question (which happens) see
>
> http://www.quirksmode.org/js/cookies.html
>
> Cookies have a "path" as well as a "domain" so you can set different
> cookies forwww.xyz.com/aandwww.xyz.com/bby setting the path to "/a"
> or "/b"
>
> Jeff Coffieldwww.digitalsynergyinc.comwww.keepmeuptodat e.net


I appreciate your kind reply.

But I am not sure whether I am going to right direction or not.

Actually, I have a program which executes the http connection and
manage session from devices.

This method "execute" does all the property settings for connection
and fetch it.

But the problem here is that any of program can call execute method
and I can not change anything from server side to maintain the
session.

I am using the CookieManager from Ian Brown.

Another problem is,

This is quite confusing, when I send a connection with JSESSIONID with
certain value, It does not return which I've sent. It returns whatever
the server sends it.

Can anyone also explain to me why?

Thanks in advance.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
indentify if argument is char or float yaniv.dg@gmail.com C Programming 34 08-08-2006 04:54 PM
undeclared indentify error inkexit@yahoo.com C++ 7 12-09-2005 03:58 AM
SRT DIvision, Square root and reciprocal square root alghazo@siu.edu VHDL 0 05-27-2004 06:23 AM
Tertiary Conditional: what does this evaluate to ("docRoot == null ? this.root : doc root")? Rick Osborn Java 10 02-08-2004 02:25 AM



Advertisments