|
From: Scott B. <sco...@ru...> - 2005-05-23 14:41:30
|
I've just started using PR3 of Webflow (nice stuff!!) and I'm trying to
get the redirect views to work.
It seems to be choking though on the following entry:
<end-state id="redirect"
view="redirect:${flowScope.service}?ticket=${flowScope.ticket}"/>
Is the above a valid statement? It seems to not be evaluating the
flowScope.service.
This is the error I get:
javax.servlet.ServletException: Could not resolve view with name
'redirect:${flowScope.service}' in servlet with name 'cas'
Thanks
-Scott
--
Scott Battaglia
Application Developer, Architecture & Engineering Team
Enterprise Systems and Services, Rutgers University
v: 732.445.0097 | f: 732.445.5493 | sco...@ru...
|
|
From: Erwin V. <erw...@er...> - 2005-05-23 15:00:18
|
Yes, that's a limitation of the current RedirectViewDescriptorCreator: it
only evaluates expressions in the values of request attributes. That will
certainly be made more generic with the next release.
For now you could do something like this:
<end-state id="redirect" view="class:com.my.CustomViewDescriptorCreator"/>
and just implement a CustomViewDescriptorCreator for your case.
Erwin Vervaet
erw...@er...
----- Original Message -----
From: "Scott Battaglia" <sco...@ru...>
To: <spr...@li...>
Sent: Monday, May 23, 2005 4:41 PM
Subject: [Springframework-developer] Spring Webflow PR3 and Redirects
> I've just started using PR3 of Webflow (nice stuff!!) and I'm trying to
> get the redirect views to work.
>
> It seems to be choking though on the following entry:
> <end-state id="redirect"
> view="redirect:${flowScope.service}?ticket=${flowScope.ticket}"/>
>
> Is the above a valid statement? It seems to not be evaluating the
> flowScope.service.
>
> This is the error I get:
> javax.servlet.ServletException: Could not resolve view with name
> 'redirect:${flowScope.service}' in servlet with name 'cas'
>
> Thanks
> -Scott
>
> --
> Scott Battaglia
> Application Developer, Architecture & Engineering Team
> Enterprise Systems and Services, Rutgers University
> v: 732.445.0097 | f: 732.445.5493 | sco...@ru...
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
|
|
From: Scott B. <sco...@ru...> - 2005-05-23 17:43:14
|
Erwin,
Thanks for the response.
One more question for you: is it possible to redirect to a specific url
(rather than a view). I tried creating a custom view descriptor creator
that did the following:
public class RedirectViewDescriptorCreator implements
ViewDescriptorCreator {
public ViewDescriptor createViewDescriptor(RequestContext
requestContext) {
final String service = (String)
ContextUtils.getAttributeFromFlowScope(requestContext,
WebConstants.SERVICE);
final String ticket = (String)
ContextUtils.getAttributeFromFlowScope(requestContext, WebConstants.TICKET);
final Map model = new HashMap();
model.put(WebConstants.TICKET, ticket);
ViewDescriptor descriptor = new ViewDescriptor(service, model);
descriptor.setRedirect(true);
return descriptor;
}
}
However, I get a an error message: javax.servlet.ServletException: Could
not resolve view with name
'redirect:https:/<machinename>:8443/contacts-cas/j_acegi_cas_security_check'
in servlet with name 'cas'
Is there a proper way to handle redirects to URLs using Webflow?
Thanks
-Scott
Erwin Vervaet wrote:
> Yes, that's a limitation of the current RedirectViewDescriptorCreator:
> it only evaluates expressions in the values of request attributes.
> That will certainly be made more generic with the next release.
>
> For now you could do something like this:
>
> <end-state id="redirect"
> view="class:com.my.CustomViewDescriptorCreator"/>
>
> and just implement a CustomViewDescriptorCreator for your case.
>
> Erwin Vervaet
> erw...@er...
> ----- Original Message ----- From: "Scott Battaglia"
> <sco...@ru...>
> To: <spr...@li...>
> Sent: Monday, May 23, 2005 4:41 PM
> Subject: [Springframework-developer] Spring Webflow PR3 and Redirects
>
>
>> I've just started using PR3 of Webflow (nice stuff!!) and I'm trying
>> to get the redirect views to work.
>>
>> It seems to be choking though on the following entry:
>> <end-state id="redirect"
>> view="redirect:${flowScope.service}?ticket=${flowScope.ticket}"/>
>>
>> Is the above a valid statement? It seems to not be evaluating the
>> flowScope.service.
>>
>> This is the error I get:
>> javax.servlet.ServletException: Could not resolve view with name
>> 'redirect:${flowScope.service}' in servlet with name 'cas'
>>
>> Thanks
>> -Scott
>>
>> --
>> Scott Battaglia
>> Application Developer, Architecture & Engineering Team
>> Enterprise Systems and Services, Rutgers University
>> v: 732.445.0097 | f: 732.445.5493 | sco...@ru...
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by Oracle Space Sweepstakes
>> Want to be the first software developer in space?
>> Enter now for the Oracle Space Sweepstakes!
>> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
>> _______________________________________________
>> Springframework-developer mailing list
>> Spr...@li...
>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
>>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Erwin V. <erw...@er...> - 2005-05-23 19:10:25
|
This is caused because of the ViewResolver(s) you have registered with the
DispatcherServlet. You don't seem to be using a UrlBasedViewResolver (e.g.
InternalResourceViewResolver), which picks up on the redirect.
Here's what's happening: I assume the value of the *service* string is
"https:/<machinename>:8443/contacts-cas/j_acegi_cas_security_check". Since
you are setting the redirect property of the view descriptor to true, the
FlowController.toModelAndView() method will actually create a ModelAndView
object with as a view name
"redirect:https:/<machinename>:8443/contacts-cas/j_acegi_cas_security_check".
This ModelAndView is passed back up to the DispatcherServlet which tries to
resolve it using a ViewResolver, as usual in Spring MVC. If you have a
UrlBasedViewResolver, it will recognize the "redirect:" prefix and construct
an appropriate RedirectView to redirect to the specified URL.
Erwin Vervaet
erw...@er...
----- Original Message -----
From: "Scott Battaglia" <sco...@ru...>
To: <spr...@li...>
Sent: Monday, May 23, 2005 7:43 PM
Subject: Re: [Springframework-developer] Spring Webflow PR3 and Redirects
> Erwin,
>
> Thanks for the response.
>
> One more question for you: is it possible to redirect to a specific url
> (rather than a view). I tried creating a custom view descriptor creator
> that did the following:
>
> public class RedirectViewDescriptorCreator implements
> ViewDescriptorCreator {
>
> public ViewDescriptor createViewDescriptor(RequestContext
> requestContext) {
> final String service = (String)
> ContextUtils.getAttributeFromFlowScope(requestContext,
> WebConstants.SERVICE);
> final String ticket = (String)
> ContextUtils.getAttributeFromFlowScope(requestContext,
> WebConstants.TICKET);
> final Map model = new HashMap();
> model.put(WebConstants.TICKET, ticket);
> ViewDescriptor descriptor = new ViewDescriptor(service, model);
> descriptor.setRedirect(true);
> return descriptor;
> }
> }
>
> However, I get a an error message: javax.servlet.ServletException: Could
> not resolve view with name
> 'redirect:https:/<machinename>:8443/contacts-cas/j_acegi_cas_security_check'
> in servlet with name 'cas'
>
> Is there a proper way to handle redirects to URLs using Webflow?
>
> Thanks
> -Scott
>
> Erwin Vervaet wrote:
>
>> Yes, that's a limitation of the current RedirectViewDescriptorCreator: it
>> only evaluates expressions in the values of request attributes. That will
>> certainly be made more generic with the next release.
>>
>> For now you could do something like this:
>>
>> <end-state id="redirect"
>> view="class:com.my.CustomViewDescriptorCreator"/>
>>
>> and just implement a CustomViewDescriptorCreator for your case.
>>
>> Erwin Vervaet
>> erw...@er...
>> ----- Original Message ----- From: "Scott Battaglia"
>> <sco...@ru...>
>> To: <spr...@li...>
>> Sent: Monday, May 23, 2005 4:41 PM
>> Subject: [Springframework-developer] Spring Webflow PR3 and Redirects
>>
>>
>>> I've just started using PR3 of Webflow (nice stuff!!) and I'm trying to
>>> get the redirect views to work.
>>>
>>> It seems to be choking though on the following entry:
>>> <end-state id="redirect"
>>> view="redirect:${flowScope.service}?ticket=${flowScope.ticket}"/>
>>>
>>> Is the above a valid statement? It seems to not be evaluating the
>>> flowScope.service.
>>>
>>> This is the error I get:
>>> javax.servlet.ServletException: Could not resolve view with name
>>> 'redirect:${flowScope.service}' in servlet with name 'cas'
>>>
>>> Thanks
>>> -Scott
>>>
>>> --
>>> Scott Battaglia
>>> Application Developer, Architecture & Engineering Team
>>> Enterprise Systems and Services, Rutgers University
>>> v: 732.445.0097 | f: 732.445.5493 | sco...@ru...
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> This SF.Net email is sponsored by Oracle Space Sweepstakes
>>> Want to be the first software developer in space?
>>> Enter now for the Oracle Space Sweepstakes!
>>> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
>>> _______________________________________________
>>> Springframework-developer mailing list
>>> Spr...@li...
>>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>>
>>>
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by Oracle Space Sweepstakes
>> Want to be the first software developer in space?
>> Enter now for the Oracle Space Sweepstakes!
>> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
>> _______________________________________________
>> Springframework-developer mailing list
>> Spr...@li...
>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
|
|
From: Scott B. <sco...@ru...> - 2005-05-23 20:10:20
|
Thanks that did the trick! Works beautifully :-D
-Scott
Erwin Vervaet wrote:
> This is caused because of the ViewResolver(s) you have registered with
> the DispatcherServlet. You don't seem to be using a
> UrlBasedViewResolver (e.g. InternalResourceViewResolver), which picks
> up on the redirect.
>
> Here's what's happening: I assume the value of the *service* string is
> "https:/<machinename>:8443/contacts-cas/j_acegi_cas_security_check".
> Since you are setting the redirect property of the view descriptor to
> true, the FlowController.toModelAndView() method will actually create
> a ModelAndView object with as a view name
> "redirect:https:/<machinename>:8443/contacts-cas/j_acegi_cas_security_check".
> This ModelAndView is passed back up to the DispatcherServlet which
> tries to resolve it using a ViewResolver, as usual in Spring MVC. If
> you have a UrlBasedViewResolver, it will recognize the "redirect:"
> prefix and construct an appropriate RedirectView to redirect to the
> specified URL.
>
> Erwin Vervaet
> erw...@er...
> ----- Original Message ----- From: "Scott Battaglia"
> <sco...@ru...>
> To: <spr...@li...>
> Sent: Monday, May 23, 2005 7:43 PM
> Subject: Re: [Springframework-developer] Spring Webflow PR3 and Redirects
>
>
>> Erwin,
>>
>> Thanks for the response.
>>
>> One more question for you: is it possible to redirect to a specific
>> url (rather than a view). I tried creating a custom view descriptor
>> creator that did the following:
>>
>> public class RedirectViewDescriptorCreator implements
>> ViewDescriptorCreator {
>>
>> public ViewDescriptor createViewDescriptor(RequestContext
>> requestContext) {
>> final String service = (String)
>> ContextUtils.getAttributeFromFlowScope(requestContext,
>> WebConstants.SERVICE);
>> final String ticket = (String)
>> ContextUtils.getAttributeFromFlowScope(requestContext,
>> WebConstants.TICKET);
>> final Map model = new HashMap();
>> model.put(WebConstants.TICKET, ticket);
>> ViewDescriptor descriptor = new ViewDescriptor(service, model);
>> descriptor.setRedirect(true);
>> return descriptor;
>> }
>> }
>>
>> However, I get a an error message: javax.servlet.ServletException:
>> Could not resolve view with name
>> 'redirect:https:/<machinename>:8443/contacts-cas/j_acegi_cas_security_check'
>> in servlet with name 'cas'
>>
>> Is there a proper way to handle redirects to URLs using Webflow?
>>
>> Thanks
>> -Scott
>>
>> Erwin Vervaet wrote:
>>
>>> Yes, that's a limitation of the current
>>> RedirectViewDescriptorCreator: it only evaluates expressions in the
>>> values of request attributes. That will certainly be made more
>>> generic with the next release.
>>>
>>> For now you could do something like this:
>>>
>>> <end-state id="redirect"
>>> view="class:com.my.CustomViewDescriptorCreator"/>
>>>
>>> and just implement a CustomViewDescriptorCreator for your case.
>>>
>>> Erwin Vervaet
>>> erw...@er...
>>> ----- Original Message ----- From: "Scott Battaglia"
>>> <sco...@ru...>
>>> To: <spr...@li...>
>>> Sent: Monday, May 23, 2005 4:41 PM
>>> Subject: [Springframework-developer] Spring Webflow PR3 and Redirects
>>>
>>>
>>>> I've just started using PR3 of Webflow (nice stuff!!) and I'm
>>>> trying to get the redirect views to work.
>>>>
>>>> It seems to be choking though on the following entry:
>>>> <end-state id="redirect"
>>>> view="redirect:${flowScope.service}?ticket=${flowScope.ticket}"/>
>>>>
>>>> Is the above a valid statement? It seems to not be evaluating the
>>>> flowScope.service.
>>>>
>>>> This is the error I get:
>>>> javax.servlet.ServletException: Could not resolve view with name
>>>> 'redirect:${flowScope.service}' in servlet with name 'cas'
>>>>
>>>> Thanks
>>>> -Scott
>>>>
>>>> --
>>>> Scott Battaglia
>>>> Application Developer, Architecture & Engineering Team
>>>> Enterprise Systems and Services, Rutgers University
>>>> v: 732.445.0097 | f: 732.445.5493 | sco...@ru...
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------
>>>> This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>> Want to be the first software developer in space?
>>>> Enter now for the Oracle Space Sweepstakes!
>>>> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
>>>> _______________________________________________
>>>> Springframework-developer mailing list
>>>> Spr...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>>>
>>>>
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> This SF.Net email is sponsored by Oracle Space Sweepstakes
>>> Want to be the first software developer in space?
>>> Enter now for the Oracle Space Sweepstakes!
>>> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
>>> _______________________________________________
>>> Springframework-developer mailing list
>>> Spr...@li...
>>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by Oracle Space Sweepstakes
>> Want to be the first software developer in space?
>> Enter now for the Oracle Space Sweepstakes!
>> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
>> _______________________________________________
>> Springframework-developer mailing list
>> Spr...@li...
>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
>>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
|