struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Mati, Abdelkader" <Abdelkader.Benm...@bnc.ca>
Subject Apache rewrite/reverse proxy
Date Mon, 15 Oct 2012 13:22:52 GMT
Hello Listers,

I have back end website running on Tomcat using struts with the following url http://local.domain.com/app.
External user access the website through apache  proxy with the following url http://www.domain.com/user1
(user1, user2, etc... It’s uri specific to each user). I want to use apache  rewrite or/
and reverse proxy  directive to translate the url like http://www.domain.com/user1 into http://local.domain.com/app?user=user1
Can some apache guru help me please?

Thanks,

Abdel

-----Original Message-----
From: Lukasz Lenart [mailto:lukaszlenart@apache.org] 
Sent: October 15, 2012 2:31 AM
To: Struts Users Mailing List
Subject: Re: person.getId() not set with url paramter using NamedVariablePatternMatcher

2012/10/15 pirzada rashid <pirzada.rashid@gmail.com>:
> Thanks for the reply. I have commented person = 
> personDAO.get(this.getId());. To make things more clear. Just wanted 
> to see Method prints "id" passed in URL. Below are changes.
> See this line below 10:56:05,583 DEBUG PersonAction:62 - 
> getPersonById() = null executed---->>>> . I get id value null. Thats the
problem.
>
> URL : http://localhost:8000/1_Struts2_Tiles_mvn/person/edit/8
>
> JSP Page:
>
> <s:url id="editURL" action="edit/%{id}" /> <s:a href="%{editURL}"><i 
> class="icon-edit"></i></s:a>
>
> struts.xml
>
> <action name="edit/*" class="com.myapp.action.PersonAction"
> method="getPersonById" >
>             <param name="id">{1}</param>
>             <interceptor-ref name="byPassValidation"/>
>             <result name="success" type="tiles">/person.edit.tiles</result>
>         </action>
>
> Action Class method
>
> public String getPersonById() throws Exception {
>         LOG.debug("getPersonById() = {} executed---->>>>", this.getId());
>         return SUCCESS;
>     }
>
> CONSOLE -> Stacktrace
>
> 10:56:05,578 DEBUG DefaultActionProxy:68 - Creating an 
> DefaultActionProxy for namespace /person and action name edit/8
> 10:56:05,581 DEBUG AbstractMatcher:68 - Attempting to match 'edit/8' 
> to a wildcard pattern, 2 available
> 10:56:05,581 DEBUG AbstractMatcher:68 - Value matches pattern 'edit/*'
> 10:56:05,582 DEBUG ParametersInterceptor:68 - Setting params
> 10:56:05,582 DEBUG DefaultWorkflowInterceptor:68 - Skipping Interceptor...
> Method [getPersonById] found in exclude list.
> 10:56:05,582 DEBUG DefaultActionInvocation:68 - Executing action 
> method = getPersonById
> 10:56:05,583 DEBUG PersonAction:62 - getPersonById() = null 
> executed---->>>>

I think the problem is how you defined your stack - it's missing a lot of other interceptors.
Take a look how it is defined in Showcase App [1]

[1] https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/showcase/src/main/resources/struts.xml


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



CONFIDENTIALITÉ : Ce document est destiné uniquement à la personne ou à l'entité à qui il
est adressé. 
L'information apparaissant dans ce document est de nature légalement privilégiée et confidentielle.
Si vous n'êtes pas 
le destinataire visé ou la personne chargée de le remettre à son destinataire, vous êtes,
par la présente, avisé que toute 
lecture, usage, copie ou communication du contenu de ce document est strictement interdit.
De plus, vous êtes prié de 
communiquer avec l'expéditeur sans délai ou d'écrire à confidentialite@bnc.ca et de détruire
ce document 
immédiatement. 

CONFIDENTIALITY: This document is intended solely for the individual or entity to whom it
is addressed. The 
information contained in this document is legally privileged and confidential. If you are
not the intended recipient or the 
person responsible for delivering it to the intended recipient, you are hereby advised that
you are strictly prohibited from 
reading, using, copying or disseminating the contents of this document. Please inform the
sender immediately or write 
to confidentiality@nbc.ca and delete this document immediately. 

Mime
View raw message