|
From: Roberto C. <rob...@in...> - 2006-07-07 13:07:26
Attachments:
SessionExceptionResolver.java
|
Hi. I wrote a slightly different version of SimpleMappingExceptionResolver which puts the exception in the http session instead of in the model. In this way it is possible to use a redirect instead of a view and still be able to access the exception to be shown to the user. Using a redirect is usually better than a view since the flow of the application after a redirect follows the normal execution of the program. What do you think? /Roberto |
|
From: Erwin V. <erw...@er...> - 2006-07-07 13:26:26
|
One possible danger of putting exceptions in the session that I see is
re-displaying 'old' errors. E.g. if for some reason the real exception isn't
put in the session the error page will pick up on the previous exception
that's still there. This can lead to very confusing situations.
Ideally the exception in the session should be removed after it has been
displayed to the user.
Erwin Vervaet
erw...@er...
----- Original Message -----
From: "Roberto Cosenza" <rob...@in...>
To: <spr...@li...>
Sent: Friday, July 07, 2006 3:05 PM
Subject: [Springframework-developer] SessionExceptionResolver
> Hi.
> I wrote a slightly different version of SimpleMappingExceptionResolver
> which puts the exception in the http session instead of in the model. In
> this way it is possible to use a redirect instead of a view and still be
> able to access the exception to be shown to the user.
> Using a redirect is usually better than a view since the flow of the
> application after a redirect follows the normal execution of the program.
> What do you think?
> /Roberto
>
--------------------------------------------------------------------------------
> package org.springframework.web.servlet.handler;
>
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpSession;
>
> import org.springframework.web.servlet.ModelAndView;
>
> /**
> * Exception resolver that allows for mapping exception class names to view
> * names as the SimpleMappingExceptionResolver. This resolver puts the
> thrown
> * exception in the HTTP session so that it can be retrieve later by a
> * controller. Using this approach permits to use a redirect view when
> handling
> * the exception while stil having access to the originating exception.
> *
> * @author Roberto Cosenza
> */
>
> public class SessionExceptionResolver extends
> SimpleMappingExceptionResolver {
>
> public final static String DEFAULT_LATEST_EXCEPTION_KEY =
> "SimpleMappingExceptionResolver.LATEST_EXCEPTION_KEY";
> private boolean forceSession = false;
> private String exceptionSessionKey = DEFAULT_LATEST_EXCEPTION_KEY;
>
> protected ModelAndView getModelAndView(String viewName, Exception ex,
> HttpServletRequest request) {
> logger.trace("getModelAndView");
> HttpSession session = request.getSession(forceSession);
> if (session != null) {
> session.setAttribute(getExceptionSessionKey(), ex);
> }
> return new ModelAndView(viewName);
> }
>
> /**
> * Tells if the session must be created if not already existing
> *
> * @return default is false
> */
> public boolean isForceSession() {
> return forceSession;
> }
>
> public void setForceSession(boolean forceSession) {
> this.forceSession = forceSession;
> }
>
> public String getExceptionSessionKey() {
> return exceptionSessionKey;
> }
>
> public void setExceptionSessionKey(String excepionSessionKey) {
> this.exceptionSessionKey = excepionSessionKey;
> }
> }
>
--------------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
--------------------------------------------------------------------------------
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|
|
From: Roberto C. <rob...@in...> - 2006-07-07 15:13:23
|
I agree with this but this responsibility is of the controller showing
the exception. Besides, if the exception resolver is used correctly, any
new exception will always replace the old one. Of course, if the users
navigates to the "error.html" page without having caused an exception ...
What I am more concerned about is the fact that if showing the exception
generates an exception which generates an exception which generates an
exception... you end up in a infinite redirect to the error.html page
There should be a way to intercept this recursive problem. Ideas?
/roberto
Erwin Vervaet wrote:
> One possible danger of putting exceptions in the session that I see is
> re-displaying 'old' errors. E.g. if for some reason the real exception isn't
> put in the session the error page will pick up on the previous exception
> that's still there. This can lead to very confusing situations.
> Ideally the exception in the session should be removed after it has been
> displayed to the user.
>
> Erwin Vervaet
> erw...@er...
> ----- Original Message -----
> From: "Roberto Cosenza" <rob...@in...>
> To: <spr...@li...>
> Sent: Friday, July 07, 2006 3:05 PM
> Subject: [Springframework-developer] SessionExceptionResolver
>
>
>> Hi.
>> I wrote a slightly different version of SimpleMappingExceptionResolver
>> which puts the exception in the http session instead of in the model. In
>> this way it is possible to use a redirect instead of a view and still be
>> able to access the exception to be shown to the user.
>> Using a redirect is usually better than a view since the flow of the
>> application after a redirect follows the normal execution of the program.
>> What do you think?
>> /Roberto
>>
>
>
> --------------------------------------------------------------------------------
>
>
>> package org.springframework.web.servlet.handler;
>>
>> import javax.servlet.http.HttpServletRequest;
>> import javax.servlet.http.HttpSession;
>>
>> import org.springframework.web.servlet.ModelAndView;
>>
>> /**
>> * Exception resolver that allows for mapping exception class names to view
>> * names as the SimpleMappingExceptionResolver. This resolver puts the
>> thrown
>> * exception in the HTTP session so that it can be retrieve later by a
>> * controller. Using this approach permits to use a redirect view when
>> handling
>> * the exception while stil having access to the originating exception.
>> *
>> * @author Roberto Cosenza
>> */
>>
>> public class SessionExceptionResolver extends
>> SimpleMappingExceptionResolver {
>>
>> public final static String DEFAULT_LATEST_EXCEPTION_KEY =
>> "SimpleMappingExceptionResolver.LATEST_EXCEPTION_KEY";
>> private boolean forceSession = false;
>> private String exceptionSessionKey = DEFAULT_LATEST_EXCEPTION_KEY;
>>
>> protected ModelAndView getModelAndView(String viewName, Exception ex,
>> HttpServletRequest request) {
>> logger.trace("getModelAndView");
>> HttpSession session = request.getSession(forceSession);
>> if (session != null) {
>> session.setAttribute(getExceptionSessionKey(), ex);
>> }
>> return new ModelAndView(viewName);
>> }
>>
>> /**
>> * Tells if the session must be created if not already existing
>> *
>> * @return default is false
>> */
>> public boolean isForceSession() {
>> return forceSession;
>> }
>>
>> public void setForceSession(boolean forceSession) {
>> this.forceSession = forceSession;
>> }
>>
>> public String getExceptionSessionKey() {
>> return exceptionSessionKey;
>> }
>>
>> public void setExceptionSessionKey(String excepionSessionKey) {
>> this.exceptionSessionKey = excepionSessionKey;
>> }
>> }
>>
>
>
> --------------------------------------------------------------------------------
>
>
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job
>> easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>
>
>
> --------------------------------------------------------------------------------
>
>
>> _______________________________________________
>> Springframework-developer mailing list
>> Spr...@li...
>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
>
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
Roberto Cosenza
Infoflex Connect AB, Sweden
Tel: +46-(0)8-55576867, Fax: +46-(0)8-55576861
--
Nordic Messaging Technologies is a trademark of Infoflex Connect.
Please visit www.nordicmessaging.se for more information about our
carrier-grade messaging products.
|
|
From: Roberto C. <rob...@in...> - 2006-07-12 12:42:53
|
Any thought about including this resolver in any spring versions?
Tx
/roberto
>>> Hi.
>>> I wrote a slightly different version of SimpleMappingExceptionResolver
>>> which puts the exception in the http session instead of in the model. In
>>> this way it is possible to use a redirect instead of a view and still be
>>> able to access the exception to be shown to the user.
>>> Using a redirect is usually better than a view since the flow of the
>>> application after a redirect follows the normal execution of the program.
>>> What do you think?
>>> /Roberto
>>>
>>
>> --------------------------------------------------------------------------------
>>
>>
>>> package org.springframework.web.servlet.handler;
>>>
>>> import javax.servlet.http.HttpServletRequest;
>>> import javax.servlet.http.HttpSession;
>>>
>>> import org.springframework.web.servlet.ModelAndView;
>>>
>>> /**
>>> * Exception resolver that allows for mapping exception class names to view
>>> * names as the SimpleMappingExceptionResolver. This resolver puts the
>>> thrown
>>> * exception in the HTTP session so that it can be retrieve later by a
>>> * controller. Using this approach permits to use a redirect view when
>>> handling
>>> * the exception while stil having access to the originating exception.
>>> *
>>> * @author Roberto Cosenza
>>> */
>>>
>>> public class SessionExceptionResolver extends
>>> SimpleMappingExceptionResolver {
>>>
>>> public final static String DEFAULT_LATEST_EXCEPTION_KEY =
>>> "SimpleMappingExceptionResolver.LATEST_EXCEPTION_KEY";
>>> private boolean forceSession = false;
>>> private String exceptionSessionKey = DEFAULT_LATEST_EXCEPTION_KEY;
>>>
>>> protected ModelAndView getModelAndView(String viewName, Exception ex,
>>> HttpServletRequest request) {
>>> logger.trace("getModelAndView");
>>> HttpSession session = request.getSession(forceSession);
>>> if (session != null) {
>>> session.setAttribute(getExceptionSessionKey(), ex);
>>> }
>>> return new ModelAndView(viewName);
>>> }
>>>
>>> /**
>>> * Tells if the session must be created if not already existing
>>> *
>>> * @return default is false
>>> */
>>> public boolean isForceSession() {
>>> return forceSession;
>>> }
>>>
>>> public void setForceSession(boolean forceSession) {
>>> this.forceSession = forceSession;
>>> }
>>>
>>> public String getExceptionSessionKey() {
>>> return exceptionSessionKey;
>>> }
>>>
>>> public void setExceptionSessionKey(String excepionSessionKey) {
>>> this.exceptionSessionKey = excepionSessionKey;
>>> }
>>> }
>>>
>>
>> --------------------------------------------------------------------------------
>>
>>
>>> Using Tomcat but need to do more? Need to support web services, security?
>>> Get stuff done quickly with pre-integrated technology to make your job
>>> easier
>>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>>
>>
>> --------------------------------------------------------------------------------
>>
>>
>>> _______________________________________________
>>> Springframework-developer mailing list
>>> Spr...@li...
>>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>>
>>
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> Springframework-developer mailing list
>> Spr...@li...
>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
> Roberto Cosenza
> Infoflex Connect AB, Sweden
> Tel: +46-(0)8-55576867, Fax: +46-(0)8-55576861
Roberto Cosenza
Infoflex Connect AB, Sweden
Tel: +46-(0)8-55576867, Fax: +46-(0)8-55576861
--
Nordic Messaging Technologies is a trademark of Infoflex Connect.
Please visit www.nordicmessaging.se for more information about our
carrier-grade messaging products.
|
|
From: Eugene K. <eu...@pl...> - 2006-07-07 18:10:17
|
Hi, I just checked out Spring and Spring modules projects from CVS and they both have build errors due to missing jars in the build path. Is there are anything that had to be done locally to resolve those errors or Eclipse projects just got out of sync? Thanks Eugene |
|
From: Colin S. <col...@ex...> - 2006-07-07 20:56:37
|
Weird, as it was ok last time I loaded the project. I will fix it if there's a real issue. Regards, Colin On 7/7/2006 2:09 PM, Eugene Kuleshov wrote: > Hi, > > I just checked out Spring and Spring modules projects from CVS and > they both have build errors due to missing jars in the build path. > > Is there are anything that had to be done locally to resolve those > errors or Eclipse projects just got out of sync? > > Thanks > > Eugene > > > > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |
|
From: Colin S. <col...@ex...> - 2006-07-07 21:12:52
|
What jars are missing in spring itself? I only see some compile errors for sandbox code... On 7/7/2006 4:56 PM, Colin Sampaleanu wrote: > Weird, as it was ok last time I loaded the project. I will fix it if > there's a real issue. > > Regards, > Colin > > > On 7/7/2006 2:09 PM, Eugene Kuleshov wrote: > >> Hi, >> >> I just checked out Spring and Spring modules projects from CVS and >> they both have build errors due to missing jars in the build path. >> >> Is there are anything that had to be done locally to resolve those >> errors or Eclipse projects just got out of sync? >> >> Thanks >> >> Eugene >> >> >> >> Using Tomcat but need to do more? Need to support web services, security? >> Get stuff done quickly with pre-integrated technology to make your job easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> > > > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |
|
From: Eugene K. <eu...@pl...> - 2006-07-07 21:16:09
|
I presume those errors caused by some missing oracle jar. Not sure which one. regards, Eugene Colin Sampaleanu wrote: > What jars are missing in spring itself? I only see some compile errors > for sandbox code... > > On 7/7/2006 4:56 PM, Colin Sampaleanu wrote: > >> Weird, as it was ok last time I loaded the project. I will fix it if >> there's a real issue. >> >> Regards, >> Colin >> >> >> On 7/7/2006 2:09 PM, Eugene Kuleshov wrote: >> >> >>> Hi, >>> >>> I just checked out Spring and Spring modules projects from CVS and >>> they both have build errors due to missing jars in the build path. >>> >>> Is there are anything that had to be done locally to resolve those >>> errors or Eclipse projects just got out of sync? >>> >>> Thanks >>> >>> Eugene >>> >>> >>> >>> Using Tomcat but need to do more? Need to support web services, security? >>> Get stuff done quickly with pre-integrated technology to make your job easier >>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >>> _______________________________________________ >>> Springframework-developer mailing list >>> Spr...@li... >>> https://lists.sourceforge.net/lists/listinfo/springframework-developer >>> >>> >>> >>> >> Using Tomcat but need to do more? Need to support web services, security? >> Get stuff done quickly with pre-integrated technology to make your job easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> > > > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: Eugene K. <eu...@pl...> - 2006-07-07 21:15:05
|
Hi, I am not sure if this list is the right place to ask this. I wonder if WebFlow editor is working in SpringIDE? I tried to build latest code from SVN and managed to run it after fixing some build errors. However I don't see how to bring up visual web flow editor and WebFlow view don't show any webflows, even those I registered in project properties (using numberguess example from WebFlow fistribution). So, I'd really appreciate any clue how to use it. Thanks in advance. Eugene |
|
From: Keith D. <ke...@in...> - 2006-07-07 21:25:58
|
Christian could say for sure but I'm almost positive the preview version of Web Flow Editor available now only supports SWF PR3. We've of course had many releases since then. :-) I know the Spring IDE team is starting work back up now that SWF has stabilized on the road to 1.0 GA, but I don't have the latest status there. Christian or Torsten would know for sure - you might want to checkout the Spring IDE forum on forum.springframework.org as well. Keith -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Eugene Kuleshov Sent: Friday, July 07, 2006 5:15 PM To: spr...@li... Subject: [Springframework-developer] SpringIDE and WebFlow support Hi, I am not sure if this list is the right place to ask this. I wonder if WebFlow editor is working in SpringIDE? I tried to build latest code from SVN and managed to run it after fixing some build errors. However I don't see how to bring up visual web flow editor and WebFlow view don't show any webflows, even those I registered in project properties (using numberguess example from WebFlow fistribution). So, I'd really appreciate any clue how to use it. Thanks in advance. Eugene Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |