Re: Session Problem for J2ee deployment
Re: Session Problem for J2ee deployment
- Subject: Re: Session Problem for J2ee deployment
- From: Farrukh Ijaz <email@hidden>
- Date: Mon, 21 Jun 2010 22:15:25 +0300
Hi Chuck,
Thanks for your suggestion. I tried that but it doesn't work. The strange thing is that the same application with same rewrite rules work perfect if run under WebObjects application server.
It's like this. My application has an admin console which is accessed using /Application/WebObjects/Application.woa context. I use this application to store some contents in the entities. To use the admin console, I must log in. However, I have a direct action which is supposed to render those contents to public. That url starts with /app/wa and is mapped to the direct action using Apache rewrite rules.
If I change the apache rewrite rule and instead of using [P] if I use [R] which is for redirect, then this /app/wa url is converted into /Application/WebObjects/Application.woa and if I'm logged in, I get the session of the logged in user. But changing back to [P], the session is not found. This only happens if I deploy application as SSDD or WAR but works perfect otherwise.
I need to dig more.
I shall keep posting the progress and will look forward for further suggestions.
Sent from my iPad
On 21-Jun-2010, at 5:00 PM, Chuck Hill <email@hidden> wrote:
> Hi Farrukh,
>
> On Jun 21, 2010, at 12:45 AM, Farrukh Ijaz wrote:
>
>> After spending sometime, I've come to know that the problem occurs if I use rewrite rules for direct actions. Below is the code:
>>
>> public WOActionResults linkManagerAction() {
>> if (!hasSession()) {
>> return blankPage();
>> }
>> return pageWithName(LinkPopupPage.class);
>> }
>>
>> protected boolean hasSession() {
>> return (getSessionIDForRequest(request()) != null) && (existingSession() != null);
>> }
>>
>> Now if I call the direct action using /Application/WebObjects/Application.woa/wa/linkManager, it gets the session.
>> But if a use /app/wa/linkManager, the session is null.
>>
>> The rewrite rule is as follows:
>>
>> RewriteRule ^/app/wa/(.*)$ /Application/WebObjects/Application.woa/wa/$1 [P]
>>
>> Any ideas please?
>
> The session is on the URL or in cookies? If on the URL, it looks like Apache is losing the Query String. Why are you using [P]? Is that for GlassFish? With normal WO deployment, I would use [L,PT]. You could try [P,QSA] or [L,PT,QSA] to see if that has any effect.
>
> Chuck
>
>
>> On 2010-06-20, at 6:01 PM, Farrukh Ijaz wrote:
>>
>>> Hi,
>>>
>>> I am facing quite a strange problem. I've an application which I've deployed on GlassFish on port 28080. Everything seems to work fine. When I use Apache mod_jk or mod_proxy_ajp module, I am getting null session for direct actions.
>>>
>>> Is this something related to Apache or WebObjects J2ee deployment?
>>>
>>> Thanks,
>>>
>>> Farrukh
>>>
>>> Sent from my iPad
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> --
> Chuck Hill Senior Consultant / VP Development
>
> Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
> http://www.global-village.net/products/practical_webobjects
>
>
>
>
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden