request dispatch in BaseFormHstComponent

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

request dispatch in BaseFormHstComponent

ramandeep0015
Hi

I have a class which is extending BaseFormHstComponent in the doAction method of this class i am dispatching the request but its not working.. sendRedirecting is working fine

I have written the following code

RequestDispatcher rd=request.getRequestDispatcher(path);
                          rd.forward(request, response);

its leading me to the blank page

Following is the stack trace

22:43:31,551 INFO  [HstComponentInvokerProfiler] Profiling: execution(HstComponentInvoker.invokeAction(..)) of content (r21_r1_r2) on /manage/edit/14-255/listing/description took 5404ms.
22:43:31,554 INFO  [HippoLoginModule] Authenticated as admin
22:43:31,576 INFO  [SecurityManager] User admin has roles [readonly] for domain htmlcleaner
22:43:31,577 INFO  [SecurityManager] User admin has privileges [jcr:read] for domain htmlcleaner
22:43:31,577 INFO  [SecurityManager] User admin has roles [readonly] for domain frontendconfig
22:43:31,577 INFO  [SecurityManager] User admin has privileges [jcr:read] for domain frontendconfig
22:43:31,577 INFO  [SecurityManager] User admin has roles [readonly] for domain defaultread
22:43:31,577 INFO  [SecurityManager] User admin has privileges [jcr:read] for domain defaultread
22:43:31,604 INFO  [SecurityManager] User admin has roles [readonly] for domain versioning
22:43:31,604 INFO  [SecurityManager] User admin has privileges [jcr:read] for domain versioning
22:43:31,604 INFO  [SecurityManager] User admin has roles [author, editor, admin] for domain everywhere
22:43:31,605 INFO  [SecurityManager] User admin has privileges [jcr:read, hippo:author, jcr:removeChildNodes, hippo:editor, jcr:getAccessControlPolicy, jcr:setAccessControlPolicy, jcr:write, hippo:admin, jcr:setProperties, jcr:addChildNodes] for domain everywhere
22:43:31,605 INFO  [SecurityManager] User admin has roles [readonly] for domain workflow
22:43:31,605 INFO  [SecurityManager] User admin has privileges [jcr:read] for domain workflow
22:43:31,605 INFO  [SecurityManager] User admin has roles [readonly] for domain hippolog
22:43:31,605 INFO  [SecurityManager] User admin has privileges [jcr:read] for domain hippolog
22:43:31,606 INFO  [SecurityManager] User admin has roles [author, editor] for domain hippodocuments
22:43:31,606 INFO  [SecurityManager] User admin has privileges [jcr:read, hippo:author, jcr:removeChildNodes, hippo:editor, jcr:write, jcr:setProperties, jcr:addChildNodes] for domain hippodocuments
22:43:31,606 INFO  [SecurityManager] User admin has roles [readwrite] for domain defaultwrite
22:43:31,606 INFO  [SecurityManager] User admin has privileges [jcr:read, jcr:removeChildNodes, jcr:write, jcr:setProperties, jcr:addChildNodes] for domain defaultwrite
22:43:31,606 INFO  [SecurityManager] User admin has roles [readonly] for domain templates
22:43:31,606 INFO  [SecurityManager] User admin has privileges [jcr:read] for domain templates
22:43:31,607 INFO  [HippoAccessManager] Initialized HippoAccessManager for user admin with cache size 20000
22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module org.hippoecm.repository.jackrabbit.FacetResultSetProvider@12aaffe
22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module org.hippoecm.repository.jackrabbit.FacetSearchProvider@1887132
22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module org.hippoecm.repository.jackrabbit.FacetSelectProvider@bfac41
22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module org.hippoecm.repository.jackrabbit.FacetSubSearchProvider@1c5f96e
22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module org.hippoecm.repository.jackrabbit.SubtypedDataProvider@7ac88b
22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module org.hippoecm.repository.jackrabbit.ViewVirtualProvider@10442d9
22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module org.hippoecm.repository.jackrabbit.facetnavigation.FacetNavigationProvider@c0f093
22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module org.hippoecm.repository.jackrabbit.facetnavigation.FacetSubNavigationProvider@f279a6
22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module org.hippoecm.repository.jackrabbit.facetnavigation.FacetsAvailableNavigationProvider@1109230
22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module org.hippoecm.repository.translation.impl.TranslationVirtualProvider@ed950a
22:43:31,613 INFO  [HippoAccessManager] Closed HippoAccessManager for user admin
22:43:31,613 WARN  [HstFilter] org.hippoecm.hst.core.container.ContainerException for '/_hn:action%7Cr21_r1_r2%7C/manage/edit/14-255/listing/description': 'org.hippoecm.hst.core.container.ContainerException: java.lang.IllegalStateException'
22:43:31,614 ERROR [[default]] Servlet.service() for servlet default threw exception
java.lang.IllegalStateException
        at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:421)
        at org.hippoecm.hst.container.HstFilter.sendError(HstFilter.java:553)
        at org.hippoecm.hst.container.HstFilter.doFilter(HstFilter.java:381)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.hippoecm.hst.container.XSSUrlFilter.doFilter(XSSUrlFilter.java:49)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)


Thanks
Ramandeep Singh
Reply | Threaded
Open this post in threaded view
|

Re: request dispatch in BaseFormHstComponent

Woonsan Ko-3
Hi Ramandeep,

HST-2 doesn't allow you to get request dispatcher directly from your HST
components.
For safe state management, HST-2 container adopts PRG pattern [1], when
posting action is involved. In PRG pattern, the page is always
redirected, so we support sendRedirect() in doAction method.
Can you explain more on why you want to do forward in doAction()?

Regards,

Woonsan

[1] http://en.wikipedia.org/wiki/Post/Redirect/Get

On 3/25/12 1:45 AM, ramandeep0015 wrote:

> Hi
>
> I have a class which is extending BaseFormHstComponent in the doAction
> method of this class i am dispatching the request but its not working..
> sendRedirecting is working fine
>
> I have written the following code
>
> RequestDispatcher rd=request.getRequestDispatcher(path);
>   rd.forward(request, response);
>
> its leading me to the blank page
>
> Following is the stack trace
>
> 22:43:31,551 INFO  [HstComponentInvokerProfiler] Profiling:
> execution(HstComponentInvoker.invokeAction(..)) of content (r21_r1_r2) on
> /manage/edit/14-255/listing/description took 5404ms.
> 22:43:31,554 INFO  [HippoLoginModule] Authenticated as admin
> 22:43:31,576 INFO  [SecurityManager] User admin has roles [readonly] for
> domain htmlcleaner
> 22:43:31,577 INFO  [SecurityManager] User admin has privileges [jcr:read]
> for domain htmlcleaner
> 22:43:31,577 INFO  [SecurityManager] User admin has roles [readonly] for
> domain frontendconfig
> 22:43:31,577 INFO  [SecurityManager] User admin has privileges [jcr:read]
> for domain frontendconfig
> 22:43:31,577 INFO  [SecurityManager] User admin has roles [readonly] for
> domain defaultread
> 22:43:31,577 INFO  [SecurityManager] User admin has privileges [jcr:read]
> for domain defaultread
> 22:43:31,604 INFO  [SecurityManager] User admin has roles [readonly] for
> domain versioning
> 22:43:31,604 INFO  [SecurityManager] User admin has privileges [jcr:read]
> for domain versioning
> 22:43:31,604 INFO  [SecurityManager] User admin has roles [author, editor,
> admin] for domain everywhere
> 22:43:31,605 INFO  [SecurityManager] User admin has privileges [jcr:read,
> hippo:author, jcr:removeChildNodes, hippo:editor,
> jcr:getAccessControlPolicy, jcr:setAccessControlPolicy, jcr:write,
> hippo:admin, jcr:setProperties, jcr:addChildNodes] for domain everywhere
> 22:43:31,605 INFO  [SecurityManager] User admin has roles [readonly] for
> domain workflow
> 22:43:31,605 INFO  [SecurityManager] User admin has privileges [jcr:read]
> for domain workflow
> 22:43:31,605 INFO  [SecurityManager] User admin has roles [readonly] for
> domain hippolog
> 22:43:31,605 INFO  [SecurityManager] User admin has privileges [jcr:read]
> for domain hippolog
> 22:43:31,606 INFO  [SecurityManager] User admin has roles [author, editor]
> for domain hippodocuments
> 22:43:31,606 INFO  [SecurityManager] User admin has privileges [jcr:read,
> hippo:author, jcr:removeChildNodes, hippo:editor, jcr:write,
> jcr:setProperties, jcr:addChildNodes] for domain hippodocuments
> 22:43:31,606 INFO  [SecurityManager] User admin has roles [readwrite] for
> domain defaultwrite
> 22:43:31,606 INFO  [SecurityManager] User admin has privileges [jcr:read,
> jcr:removeChildNodes, jcr:write, jcr:setProperties, jcr:addChildNodes] for
> domain defaultwrite
> 22:43:31,606 INFO  [SecurityManager] User admin has roles [readonly] for
> domain templates
> 22:43:31,606 INFO  [SecurityManager] User admin has privileges [jcr:read]
> for domain templates
> 22:43:31,607 INFO  [HippoAccessManager] Initialized HippoAccessManager for
> user admin with cache size 20000
> 22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module
> org.hippoecm.repository.jackrabbit.FacetResultSetProvider@12aaffe
> 22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module
> org.hippoecm.repository.jackrabbit.FacetSearchProvider@1887132
> 22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module
> org.hippoecm.repository.jackrabbit.FacetSelectProvider@bfac41
> 22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module
> org.hippoecm.repository.jackrabbit.FacetSubSearchProvider@1c5f96e
> 22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module
> org.hippoecm.repository.jackrabbit.SubtypedDataProvider@7ac88b
> 22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module
> org.hippoecm.repository.jackrabbit.ViewVirtualProvider@10442d9
> 22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module
> org.hippoecm.repository.jackrabbit.facetnavigation.FacetNavigationProvider@c0f093
> 22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module
> org.hippoecm.repository.jackrabbit.facetnavigation.FacetSubNavigationProvider@f279a6
> 22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module
> org.hippoecm.repository.jackrabbit.facetnavigation.FacetsAvailableNavigationProvider@1109230
> 22:43:31,612 INFO  [HippoLocalItemStateManager] Provider module
> org.hippoecm.repository.translation.impl.TranslationVirtualProvider@ed950a
> 22:43:31,613 INFO  [HippoAccessManager] Closed HippoAccessManager for user
> admin
> 22:43:31,613 WARN  [HstFilter]
> org.hippoecm.hst.core.container.ContainerException for
> '/_hn:action%7Cr21_r1_r2%7C/manage/edit/14-255/listing/description':
> 'org.hippoecm.hst.core.container.ContainerException:
> java.lang.IllegalStateException'
> 22:43:31,614 ERROR [[default]] Servlet.service() for servlet default threw
> exception
> java.lang.IllegalStateException
> at
> org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:421)
> at org.hippoecm.hst.container.HstFilter.sendError(HstFilter.java:553)
> at org.hippoecm.hst.container.HstFilter.doFilter(HstFilter.java:381)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.hippoecm.hst.container.XSSUrlFilter.doFilter(XSSUrlFilter.java:49)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
> at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
> at
> org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
> at
> org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> at java.lang.Thread.run(Thread.java:619)
>
>
> Thanks
> Ramandeep Singh
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/request-dispatch-in-BaseFormHstComponent-tp7402666p7402666.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: request dispatch in BaseFormHstComponent

ramandeep0015
In reply to this post by ramandeep0015
Hi Woonsan

I have a search functionality,
I have search form. when i will submit the form i have to fetch the nodes from JCR acco to the attributes filled and then show those nodes data in next page

So i was thinking of searching the node in doaction and then setting the node data in request and showing them in next page

Thanks & Regards
Ramandeep Singh
Ard
Reply | Threaded
Open this post in threaded view
|

Re: request dispatch in BaseFormHstComponent

Ard
On Mon, Mar 26, 2012 at 9:00 AM, ramandeep0015 <[hidden email]> wrote:
> Hi Woonsan
>
> I have a search functionality,
> I have search form. when i will submit the form i have to fetch the nodes
> from JCR acco to the attributes filled and then show those nodes data in
> next page
>
> So i was thinking of searching the node in doaction and then setting the
> node data in request and showing them in next page

Searching is never an action. Actions are meant for modifying state on
the server. You are just reading.

Why can't you just do a normal search?

Regards Ard

>
> Thanks & Regards
> Ramandeep Singh
>
> --
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: request dispatch in BaseFormHstComponent

ramandeep0015
Hi Ard

Normal Search ? What do you mean by normal search.

I have some filters in my form like between two dates and so on
So i first fill the form and then i have to search nodes acco to the filters and the show the data in the next page

Can you please give me some source or example of normal search

Thanks
Ramandeep Singh
Ard
Reply | Threaded
Open this post in threaded view
|

Re: request dispatch in BaseFormHstComponent

Ard
On Sun, Apr 1, 2012 at 8:30 AM, ramandeep0015 <[hidden email]> wrote:
> Hi Ard
>
> Normal Search ? What do you mean by normal search.

Every search basically. Searches do not modify state on the server in
general. They basically have nothing to do with an action. They are
just normal gets with some query parameters.

So, when you do not want to see query parameters, you use 'post' as
method, but the action of your form should not be an <hst:actionURL/>
but just a normal <hst:link/>

>
> I have some filters in my form like between two dates and so on
> So i first fill the form and then i have to search nodes acco to the filters
> and the show the data in the next page
>
> Can you please give me some source or example of normal search

Take a look at [1] or [2].

Regards Ard

[1] https://svn.onehippo.org/repos/hippo/hippo-cms7/testsuite/tags/hippo-testsuite-1.02.00/
[2] https://svn.onehippo.org/repos/hippo/hippo-demos/hippo-go-green/trunk/


>
> Thanks
> Ramandeep Singh
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/request-dispatch-in-BaseFormHstComponent-tp7402666p7426238.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



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html