ContainerException when a post is performed

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

ContainerException when a post is performed

Priyank Gupta
when i am submiting my form i have get this error on browser HTTP status 500

and on cmd i have get the Exception [INFO] [talledLocalContainer] 07.03.2013 22:49:15 WARN  [org.hippoecm.hst.container.HstFilter.doFilter():435] org.hippoecm.hst.core.container.ContainerException for '/site
/_hn:action%7Cr85_r1_r1%7C/residentialstatus': 'org.hippoecm.hst.core.container.ContainerException: Can only redirect to a context relative path starting with a '/'.'
Reply | Threaded
Open this post in threaded view
|

Re: ContainerException when a post is performed

Woonsan Ko-3
Hi,

The error message is logged only when an hst component implementation
tried to invoke response.sendRedirect(location) method with a location
which doesn't start with '/'.
Can you check the invocation in your component implementation?

Regards,

Woonsan

On 3/7/13 1:02 PM, Priyank Gupta wrote:

> when i am submiting my form i have get this error on browser HTTP status 500
>
> and on cmd i have get the Exception [INFO] [talledLocalContainer] 07.03.2013
> 22:49:15 WARN  [org.hippoecm.hst.container.HstFilter.doFilter():435]
> org.hippoecm.hst.core.container.ContainerException for '/site
> /_hn:action%7Cr85_r1_r1%7C/residentialstatus':
> 'org.hippoecm.hst.core.container.ContainerException: Can only redirect to a
> context relative path starting with a '/'.'
>
>
>
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/ContainerException-when-a-post-is-performed-tp7580595.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
>


--
[hidden email]     www.onehippo.com
Boston - 1 Broadway, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: ContainerException when a post is performed

Priyank Gupta
thanks
  But I am using a form tag which have <hst:actionUrl> in it's action attribute so when i am submitting my form then it throw above error.
any idea about it on browser url i have following as
http://localhost:8080/site/_hn:action%7Cr85_r1_r1%7C/residentialstatus?pi_resi_stat=RES-Resident&x=50&y=25&pi_resi_stat_2=
see bold part

Reply | Threaded
Open this post in threaded view
|

Re: ContainerException when a post is performed

Woonsan Ko-3
The encoded url for the action was intended by HST-2 container.
Don't you have #doAction() method implementation with redirection code
in your hst component which is responsible for processing the submitted
form data?

On 3/7/13 1:32 PM, Priyank Gupta wrote:

> thanks
>   But I am using a form tag which have <hst:actionUrl> in it's action
> attribute so when i am submitting my form then it throw above error.
> any idea about it on browser url i have following as
> http://localhost:8080/site/*_hn:action%7Cr85_r1_r1%7C*/residentialstatus?pi_resi_stat=RES-Resident&x=50&y=25&pi_resi_stat_2=
> see bold part
>
>
>
>
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/ContainerException-when-a-post-is-performed-tp7580595p7580597.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
>


--
[hidden email]     www.onehippo.com
Boston - 1 Broadway, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: ContainerException when a post is performed

Priyank Gupta
No i have do action method in java file
Reply | Threaded
Open this post in threaded view
|

Re: ContainerException when a post is performed

Woonsan Ko-3
If you have #doAction() method in java file, then could you copy and
paste the code fragment of #doAction() here or check if it has
".sendRedirect" in the java file?

On 3/7/13 1:51 PM, Priyank Gupta wrote:

> No i have do action method in java file
>
>
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/ContainerException-when-a-post-is-performed-tp7580595p7580599.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
>


--
[hidden email]     www.onehippo.com
Boston - 1 Broadway, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: ContainerException when a post is performed

Priyank Gupta
i have do Action code and it have sendRedirect method

public void doAction(HstRequest request, HstResponse response)
                        throws HstComponentException {
                // TODO Auto-generated method stub
                super.doBeforeRender(request, response);
                String pan=getPublicRequestParameter(request,"pan");
                //check get parameter pan have value or not
                if(pan!=null){
                        String resident=GoGreenUtil.getEscapedParameter(request,"pi_resi_stat");
                        if(resident==null){
                                resident=GoGreenUtil.getEscapedParameter(request,"pi_resi_stat_2");
                        }
                        //check any choice select for Residential status
                        /*if(resident.equals("Select One")){
                                response.setRenderParameter(ERROR,"Please enter");
                                return;
                        }*/
                        /*Create the MemberPersoanlInformation Document Object
                         * Set the Values get from Form
                         * */
                        MemberPersonalInformation msd=new MemberPersonalInformation();
                        msd.setResident(resident);
                        createMemberPersonalInformation(request,msd,pan);
                        try {
                                response.sendRedirect("site/bankdetail?pan="+pan);
                        } catch (IOException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
                }else{
                        try {
                                response.sendRedirect("site/memberLogin");
                        } catch (IOException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
                }
        }
Reply | Threaded
Open this post in threaded view
|

Re: ContainerException when a post is performed

Woonsan Ko-3
Can you replace those two lines like the following and try again?

response.sendRedirect("site/memberLogin");
--> response.sendRedirect("/memberLogin");

response.sendRedirect("site/bankdetail?pan="+pan);
--> response.sendRedirect("/bankdetail?pan="+pan);

The parameters should start with '/' and context path (e.g., '/site')
will be automatically resolved by HST-2 container.

Regards,

Woonsan

On 3/7/13 2:05 PM, Priyank Gupta wrote:

> i have do Action code and it have sendRedirect method
>
> public void doAction(HstRequest request, HstResponse response)
> throws HstComponentException {
> // TODO Auto-generated method stub
> super.doBeforeRender(request, response);
> String pan=getPublicRequestParameter(request,"pan");
> //check get parameter pan have value or not
> if(pan!=null){
> String resident=GoGreenUtil.getEscapedParameter(request,"pi_resi_stat");
> if(resident==null){
> resident=GoGreenUtil.getEscapedParameter(request,"pi_resi_stat_2");
> }
> //check any choice select for Residential status
> /*if(resident.equals("Select One")){
> response.setRenderParameter(ERROR,"Please enter");
> return;
> }*/
> /*Create the MemberPersoanlInformation Document Object
> * Set the Values get from Form
> * */
> MemberPersonalInformation msd=new MemberPersonalInformation();
> msd.setResident(resident);
> createMemberPersonalInformation(request,msd,pan);
> try {
> response.sendRedirect("site/bankdetail?pan="+pan);
> } catch (IOException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }else{
> try {
> response.sendRedirect("site/memberLogin");
> } catch (IOException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
> }
>
>
>
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/ContainerException-when-a-post-is-performed-tp7580595p7580601.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
>


--
[hidden email]     www.onehippo.com
Boston - 1 Broadway, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: ContainerException when a post is performed

Priyank Gupta
sorry!
thanks for replying
Now i ahve got it that response.sendRedirect("site/memberLogin"); will not work it will throw that error
but when i used response.sendRedirect("/site/memberLogin"); it does not send that error


Thanks
priyank