[Wicket-user] Proxessing uncaught exceptions
Is it possible to override standard Wicket exception page? I would like to throw exceptions on lower levels and have a generic error page that will display messages from custom exceptions and something like internal error for system exception. - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Proxessing uncaught exceptions
Yes, take a look at IApplicationSettings.setInternalErrorPage(). Frank Bille On Tue, 2006-07-11 at 09:46 +0300, Tymur Porkuyan wrote: Is it possible to override standard Wicket exception page? I would like to throw exceptions on lower levels and have a generic error page that will display messages from custom exceptions and something like internal error for system exception. - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Proxessing uncaught exceptions
If you want to get hold on the actual exception that has been thrown you need to override the ExceptionResponseStrategy in DefaultWebRequestCycleProcessor. Do something like this: In you WebApplication extended class: @Override protected IRequestCycleProcessor newRequestCycleProcessor() { return new MyDefaultWebRequestCycleProcessor(); } MyDefaultWebRequestCycleProcessor.java: public class MyDefaultWebRequestCycleProcessor extends DefaultWebRequestCycleProcessor { @Override protected IExceptionResponseStrategy newExceptionResponseStrategy() { return new IExceptionResponseStrategy() { public void respond(RequestCycle requestCycle, RuntimeException e) { requestCycle.setResponsePage(new MyExceptionPage(e)); } }; } } And then you can have your exception page: public class MyExceptionPage extends WebPage { private static final long serialVersionUID = 1L; public MyExceptionPage(Throwable throwable) { add(new Label(title, throwable.getMessage())); // and whatever you like } @Override protected void configureResponse() { super.configureResponse(); getWebRequestCycle().getWebResponse().getHttpServletResponse() .setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } @Override public boolean isErrorPage() { return true; } @Override public boolean isVersioned() { return false; } } Regards Frank Bille On Tue, 2006-07-11 at 09:30 +0200, Frank Bille Jensen wrote: Yes, take a look at IApplicationSettings.setInternalErrorPage(). Frank Bille On Tue, 2006-07-11 at 09:46 +0300, Tymur Porkuyan wrote: Is it possible to override standard Wicket exception page? I would like to throw exceptions on lower levels and have a generic error page that will display messages from custom exceptions and something like internal error for system exception. - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] wicket.markup.html.include.Include / encoding error
Hi Im a little curious about this. I have an file stream which is delivered(actually a html file) to me, I then write the file as a temporary file: String path = ((WebRequest) page.getRequest()) .getHttpServletRequest().getSession(false) .getServletContext().getRealPath(/report); File dir = new File(path); File file = File.createTempFile(rep, extension, dir); Files.writeTo(file, new ByteArrayInputStream(report)); url = "" + file.getName(); Then include it : add(new Include(result, url)); However the html file contains both the html tag and body tag, this does not give me give any direct problems. However I in my wicket html template file specify: meta http-equiv=Content-Type content=text/html; charset=utf-8 / but the included html specify: meta http-equiv=Content-type content=text/html; charset=iso-8859-1 If I open the delivered file in an text editor it tells med that its an ANSI encoding. Can I somehow make the Files.writeTo use UTF-8 encoding, and will it still show up wrong because of the iso-8859-1 specified in the included file? Currently it looks to me like its the include that properly corrups the chars, im guessing its because file encoding is specified to ANSI but we have special chars like æ,ø,å. Hoping for some help Regards Nino - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] wizard sample - same URL
Hi, the wicket wizard component (http://www.wicket-library.com/wicket-examples/wizard) takes advantage of using the same URL for more (wizard) pages. The browser's Back button then skips all wizard pages with same URL and jumps to the page before the wizard. I want to ask if this functionality is part of the HTTP protocol, or, in other words, if it is safe to use this in real application. Does it work in all current browsers? Is it documented somewhere? Thanks, Jan - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Proxessing uncaught exceptions
or simply override requestcycle.onruntimeexception-IgorOn 7/11/06, Frank Bille Jensen [EMAIL PROTECTED] wrote:If you want to get hold on the actual exception that has been thrown you need to override the ExceptionResponseStrategy inDefaultWebRequestCycleProcessor. Do something like this:In you WebApplication extended class:@Overrideprotected IRequestCycleProcessor newRequestCycleProcessor() { return new MyDefaultWebRequestCycleProcessor();}MyDefaultWebRequestCycleProcessor.java:public class MyDefaultWebRequestCycleProcessor extendsDefaultWebRequestCycleProcessor { @Overrideprotected IExceptionResponseStrategy newExceptionResponseStrategy() {return new IExceptionResponseStrategy() {public void respond(RequestCycle requestCycle, RuntimeException e) { requestCycle.setResponsePage(new MyExceptionPage(e));}};}}And then you can have your exception page:public class MyExceptionPage extends WebPage { private static final long serialVersionUID = 1L;public MyExceptionPage(Throwable throwable) {add(new Label(title, throwable.getMessage()));// and whatever you like }@Overrideprotected void configureResponse() {super.configureResponse();getWebRequestCycle().getWebResponse().getHttpServletResponse().setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR);}@Overridepublic boolean isErrorPage() {return true;}@Overridepublic boolean isVersioned() { return false;}}RegardsFrank BilleOn Tue, 2006-07-11 at 09:30 +0200, Frank Bille Jensen wrote: Yes, take a look at IApplicationSettings.setInternalErrorPage (). Frank Bille On Tue, 2006-07-11 at 09:46 +0300, Tymur Porkuyan wrote: Is it possible to override standard Wicket exception page? I would like to throw exceptions on lower levels and have a generic error page that will display messages from custom exceptions and something like internal error for system exception.- 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 easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] wizard sample - same URL
i believe this is part of the browser implementation. at least as of a while ago all browsers except opera behaved like that. i dont know about opera 9-IgorOn 7/11/06, jan_bar [EMAIL PROTECTED] wrote: Hi,the wicket wizard component(http://www.wicket-library.com/wicket-examples/wizard) takes advantage ofusing the same URL for more (wizard) pages. The browser's Back button then skips all wizard pages with same URL and jumps to the page before thewizard. I want to ask if this functionality is part of the HTTP protocol,or, in other words, if it is safe to use this in real application. Does it work in all current browsers? Is it documented somewhere?Thanks, Jan-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 easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Downloading a file generated on the fly
I would like to create a text file on the fly and then create a link which will initiate a download of this file. I checked out the exampleat http://www.wicket-wiki.org.uk/wiki/index.php/UploadDownload#Downloading_Images. I am thinking that I can do something similar but extend DynamicWebResource. Then use ResourceLink to link to it... Would this work? Is there a better way to do it? J Important Notice to Recipients: It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley. - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Downloading a file generated on the fly
dont take this liteteraly but here it isadd(new Link(link) { onclick() { String txt=generatefile(); WebRequestCycle.get().setResponseTarget(new ResponseTarget() { void respond() { WebResponse r=WebRequestCycle.get().getResponse(); r.setAttachmentHeader(filename); Streams.copy(new StringInputStream(txt), r.getOutputStream ); } }}-Igor On 7/11/06, Levy, Jeremy [EMAIL PROTECTED] wrote: I would like to create a text file on the fly and then create a link which will initiate a download of this file. I checked out the exampleat http://www.wicket-wiki.org.uk/wiki/index.php/UploadDownload#Downloading_Images . I am thinking that I can do something similar but extend DynamicWebResource. Then use ResourceLink to link to it... Would this work? Is there a better way to do it? J Important Notice to Recipients: It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley. -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=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Downloading a file generated on the fly
Thanks Sean and Igor, based on both your responses I've come up with roughly the following which is working: final String filename = "thefile.csv"; final String contentType = "text/csv"; final String content = "the,content,is,this"; add(new Link("link"){ public void onClick(){ RequestCycle.get().setRequestTarget(EmptyRequestTarget.getInstance()); WebResponse response = (WebResponse) getResponse(); response.setContentType(contentType); response.setAttachmentHeader(filename); response.setHeader("Cache-Control", "max-age=0"); OutputStream out = response.getOutputStream(); try { out.write(content.getBytes()); out.flush(); } catch (IOException ex) { // ignore } } }); From: Sean Sullivan [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 11:16 AMTo: Levy, JeremySubject: Re: [Wicket-user] Downloading a file generated on the fly Here's an application that I wrote.The application retrieves data from a database and converts it to an Excel XLS file.I am sending the XLS file to the web browser via the ServletOutputStream.Note: DatabaseQueryForm extends BaseFormhttp://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/DatabaseQueryForm.java?view=markuprev=91http://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/BaseForm.java?view=markuprev=60Levy, Jeremy wrote: I would like to create a text file on the fly and then create a link which will initiate a download of this file. I checked out the exampleat http://www.wicket-wiki.org.uk/wiki/index.php/UploadDownload#Downloading_Images. I am thinking that I can do something similar but extend DynamicWebResource. Then use ResourceLink to link to it... Would this work? Is there a better way to do it? J Important Notice to Recipients: It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley. - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user Important Notice to Recipients: It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley. - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Downloading a file generated on the fly
while this works it is a bit hacky. it would be better to let the requesttarget's response method produce the output.-IgorOn 7/11/06, Levy, Jeremy [EMAIL PROTECTED] wrote: Thanks Sean and Igor, based on both your responses I've come up with roughly the following which is working: final String filename = thefile.csv; final String contentType = text/csv; final String content = the,content,is,this; add(new Link(link){ public void onClick(){ RequestCycle.get().setRequestTarget(EmptyRequestTarget.getInstance()); WebResponse response = (WebResponse) getResponse(); response.setContentType(contentType); response.setAttachmentHeader(filename); response.setHeader(Cache-Control, max-age=0); OutputStream out = response.getOutputStream(); try { out.write(content.getBytes()); out.flush(); } catch (IOException ex) { // ignore } } }); From: Sean Sullivan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 11, 2006 11:16 AMTo: Levy, JeremySubject: Re: [Wicket-user] Downloading a file generated on the fly Here's an application that I wrote.The application retrieves data from a database and converts it to an Excel XLS file.I am sending the XLS file to the web browser via the ServletOutputStream.Note: DatabaseQueryForm extends BaseForm http://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/DatabaseQueryForm.java?view=markuprev=91 http://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/BaseForm.java?view=markuprev=60Levy, Jeremy wrote: I would like to create a text file on the fly and then create a link which will initiate a download of this file. I checked out the exampleat http://www.wicket-wiki.org.uk/wiki/index.php/UploadDownload#Downloading_Images . I am thinking that I can do something similar but extend DynamicWebResource. Then use ResourceLink to link to it... Would this work? Is there a better way to do it? J Important Notice to Recipients: It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley. -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=lnkkid=120709bid=263057dat=121642 ___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user Important Notice to Recipients: It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley. -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=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Downloading a file generated on the fly
I'd like to do it the clean way... When I do this: RequestCycle.get().setRequestTarget(new StringRequestTarget("hello"){ public void respond(){ String txt = "content"; WebResponse r=(WebResponse) WebRequestCycle.get().getResponse(); r.setAttachmentHeader(filename); r.setContentType(contentType); try { Streams.copy(new StringInputStream(txt), r.getOutputStream() ); } catch (IOException ex) { ex.printStackTrace(); } } }); The content shows up as "hello" and opens in the browser not as the correct content type, I'm sure I'm using the wrong kind of IRequestTarget, which one should I use? I can't figure out the syntax for EmptyRequestTarget and still override respond(). J From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor VaynbergSent: Tuesday, July 11, 2006 12:21 PMTo: wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] Downloading a file generated on the fly while this works it is a bit hacky. it would be better to let the requesttarget's response method produce the output.-Igor On 7/11/06, Levy, Jeremy [EMAIL PROTECTED] wrote: Thanks Sean and Igor, based on both your responses I've come up with roughly the following which is working: final String filename = "thefile.csv"; final String contentType = "text/csv"; final String content = "the,content,is,this"; add(new Link("link"){ public void onClick(){ RequestCycle.get().setRequestTarget(EmptyRequestTarget.getInstance()); WebResponse response = (WebResponse) getResponse(); response.setContentType(contentType); response.setAttachmentHeader(filename); response.setHeader("Cache-Control", "max-age=0"); OutputStream out = response.getOutputStream(); try { out.write(content.getBytes()); out.flush(); } catch (IOException ex) { // ignore } } }); From: Sean Sullivan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 11, 2006 11:16 AMTo: Levy, JeremySubject: Re: [Wicket-user] Downloading a file generated on the fly Here's an application that I wrote.The application retrieves data from a database and converts it to an Excel XLS file.I am sending the XLS file to the web browser via the ServletOutputStream.Note: DatabaseQueryForm extends BaseFormhttp://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/DatabaseQueryForm.java?view=markuprev=91http://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/BaseForm.java?view=markuprev=60 Levy, Jeremy wrote: I would like to create a text file on the fly and then create a link which will initiate a download of this file. I checked out the exampleat http://www.wicket-wiki.org.uk/wiki/index.php/UploadDownload#Downloading_Images . I am thinking that I can do something similar but extend DynamicWebResource. Then use ResourceLink to link to it... Would this work? Is there a better way to do it? J Important Notice to Recipients: It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley. -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=lnkkid=120709bid=263057dat=121642 ___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user Important Notice to Recipients: It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley. -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 Geronimohttp://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user Important Notice to Recipients:
Re: [Wicket-user] SSL
Using the ONE_PASS method rendering strategy everything works fine now. Did you have to do the same?ThanksOn 7/10/06, [EMAIL PROTECTED] Imam [EMAIL PROTECTED] wrote: Hi,I had a similar problemI decided not to use that RequiredSSL method.Instead i maintain an array of page classes that require https and used the following code. It worked fine for me. Hope it helps you. protected IResponseStrategy newResponseStrategy() { return new IResponseStrategy() { @SuppressWarnings(unchecked) public void respond( RequestCycle requestCycle ) {IRequestTarget requestTarget = requestCycle.getRequestTarget();if( requestTarget != null ) { Application.get().logResponseTarget( requestTarget ); WebRequest webRequest = (WebRequest) requestCycle.getRequest(); WebResponse webResponse = (WebResponse) requestCycle .getResponse(); HttpServletRequest httpServletRequest = webRequest .getHttpServletRequest(); Class pageClass = null; if( requestTarget instanceof IPageRequestTarget ) { IPageRequestTarget pageTarget = (IPageRequestTarget) requestTarget; pageClass = pageTarget.getPage().getClass(); } else if( requestTarget instanceof IBookmarkablePageRequestTarget ) { IBookmarkablePageRequestTarget bookmarkableTarget = (IBookmarkablePageRequestTarget) requestTarget; pageClass = bookmarkableTarget.getPageClass(); } boolean isSecurityRequired = false; if( pageClass != null ) { for( int i = 0; i secureClasses.length !isSecurityRequired; i++ ) { isSecurityRequired = secureClasses[i] .isAssignableFrom( pageClass ); } } if( pageClass != null !httpServletRequest.isSecure()isSecurityRequired ) { StringBuffer url = "" StringBuffer( https://+ httpServletRequest.getServerName() ); url.append( : + getSslPortNumber() ); String q = RequestCycle.get().urlFor( requestTarget ).toString(); url.append( q ); webResponse.redirect ( url.toString() ); } else if( httpServletRequest.isSecure() !isSecurityRequired ) { StringBuffer url = "" StringBuffer( http:// + httpServletRequest.getServerName() ); url.append( : + getNormalPortNumber() ); String q = RequestCycle.get().urlFor( requestTarget ) .toString(); url.append( q ); webResponse.redirect( url.toString() ); } else { requestTarget.respond( requestCycle ); } } }; }Shams. On 7/10/06, Johan Compagner [EMAIL PROTECTED] wrote: then you are doing the redirect wrong.How and when do you do the redirect??On 7/7/06, Joe Toth [EMAIL PROTECTED] wrote:Weird...I'm only getting the error in Jetty 6 (Beta17). wicket.WicketRuntimeException: Internal Error: Could not render error page class wicket.markup.html.pages.InternalErrorPage at wicket.request.compound.DefaultExceptionResponseStrategy.respond (DefaultExceptionResponseStrategy.java:109) at wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(AbstractCompoundRequestCycleProcessor.java:76) at wicket.RequestCycle.step(RequestCycle.java :1000) at wicket.RequestCycle.steps(RequestCycle.java:1034) at wicket.RequestCycle.request(RequestCycle.java:453) at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:215) at javax.servlet.http.HttpServlet.service (HttpServlet.java:747) at javax.servlet.http.HttpServlet.service(HttpServlet.java:860) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:423) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:966) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) at org.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java:77) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:957) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:353) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:567) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java :126) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:119) at org.mortbay.jetty.Server.handle(Server.java:248) at org.mortbay.jetty.HttpConnection.handlerRequest(HttpConnection.java :360) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:614) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:487) at org.mortbay.jetty.HttpParser.parseAvailable (HttpParser.java:197) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:288) at org.mortbay.jetty.nio.SelectChannelConnector$HttpChannelEndPoint.run(SelectChannelConnector.java:805) at org.mortbay.thread.BoundedThreadPool$PoolThread.run (BoundedThreadPool.java:475)Caused by: wicket.WicketRuntimeException: Already redirecting to
[Wicket-user] Mark up inheritance question
Title: Mark up inheritance question Hi, I have a child class B inheriting from a modal window with certain functionality A. With the exception of a few additional components in the child class B, the functionality of class A and B are similar. Is there a way to do this using mark up inheritance in wicket? Thanks - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Downloading a file generated on the fly
Cool thanks, I used the anonymous IRequestTarget strategy... From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor VaynbergSent: Tuesday, July 11, 2006 1:11 PMTo: wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] Downloading a file generated on the fly string target already does the streams.copy thing in its respond so you can just dorespond() { ... r.setattachmentheader(..); r.setContentType(..) super.respond(); }or do how i showed you in the first place using an anonymous imple of IRequestTarget directly. IRequestTarget.detach() { } IRequestTarget.getLock() { return null; }-Igor On 7/11/06, Levy, Jeremy [EMAIL PROTECTED] wrote: I'd like to do it the clean way... When I do this: RequestCycle.get().setRequestTarget(new StringRequestTarget("hello"){ public void respond(){ String txt = "content"; WebResponse r=(WebResponse) WebRequestCycle.get().getResponse(); r.setAttachmentHeader(filename); r.setContentType(contentType); try { Streams.copy(new StringInputStream(txt), r.getOutputStream() ); } catch (IOException ex) { ex.printStackTrace(); } } }); The content shows up as "hello" and opens in the browser not as the correct content type, I'm sure I'm using the wrong kind of IRequestTarget, which one should I use? I can't figure out the syntax for EmptyRequestTarget and still override respond(). J From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Igor VaynbergSent: Tuesday, July 11, 2006 12:21 PMTo: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Downloading a file generated on the fly while this works it is a bit hacky. it would be better to let the requesttarget's response method produce the output.-Igor On 7/11/06, Levy, Jeremy [EMAIL PROTECTED] wrote: Thanks Sean and Igor, based on both your responses I've come up with roughly the following which is working: final String filename = "thefile.csv"; final String contentType = "text/csv"; final String content = "the,content,is,this"; add(new Link("link"){ public void onClick(){ RequestCycle.get().setRequestTarget(EmptyRequestTarget.getInstance()); WebResponse response = (WebResponse) getResponse(); response.setContentType(contentType); response.setAttachmentHeader(filename); response.setHeader("Cache-Control", "max-age=0"); OutputStream out = response.getOutputStream(); try { out.write(content.getBytes()); out.flush(); } catch (IOException ex) { // ignore } } }); From: Sean Sullivan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 11, 2006 11:16 AMTo: Levy, JeremySubject: Re: [Wicket-user] Downloading a file generated on the fly Here's an application that I wrote.The application retrieves data from a database and converts it to an Excel XLS file.I am sending the XLS file to the web browser via the ServletOutputStream.Note: DatabaseQueryForm extends BaseFormhttp://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/DatabaseQueryForm.java?view=markuprev=91http://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/BaseForm.java?view=markuprev=60 Levy, Jeremy wrote: I would like to create a text file on the fly and then create a link which will initiate a download of this file. I checked out the exampleat http://www.wicket-wiki.org.uk/wiki/index.php/UploadDownload#Downloading_Images . I am thinking that I can do something similar but extend DynamicWebResource. Then use ResourceLink to link to it... Would this work? Is there a better way to do it? J Important Notice to Recipients: It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley. -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=lnkkid=120709bid=263057dat=121642 ___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Tooltip Suggestions
I'm starting to look into using dynamic tooltips in our Wicket application, and was wondering if anybody had some basic advice or tips to get us going in the right direction. Does the Dojo plugin work with the latest version of Wicket? Has anybody else implemented a dynamic tooltip widget? Any ideas would be appreciated! Thanks, Jeff - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Tooltip Suggestions
here are some _javascript_ libs you can use:http://del.icio.us/ivaynberg/tooltip-IgorOn 7/11/06, Jeff Lin [EMAIL PROTECTED] wrote:I'm starting to look into using dynamic tooltips in our Wicket application, and was wondering if anybody had some basic advice ortips to get us going in the right direction. Does the Dojo pluginwork with the latest version of Wicket? Has anybody else implementeda dynamic tooltip widget? Any ideas would be appreciated! Thanks,Jeff-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 Geronimohttp://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Objects.cloneObject
If i try to clone an object that is not in the ClassLoader of the wicket jar, this will fail on ClassNotFound I don't know enough about serialization, but is there a way to use object.getClassLoader to do the deserialization? Thanks, ittay -- === Ittay Dror, Chief architect, openQRM TL, RD, Qlusters Inc. [EMAIL PROTECTED] +972-3-6081994 Fax: +972-3-6081841 http://www.openQRM.org - Keeps your Data-Center Up and Running - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Is it possible to abort a request?
Thanks, exactly what I was looking for. Adam On Jul 10, 2006, at 6:27 PM, Eelco Hillenius wrote: Yep. Look at AbortException and subclasses. You might be looking for AbortWithHttpStatusException. Eelco On 7/10/06, Adam Smyczek [EMAIL PROTECTED] wrote: Hi All, This is probably a simple question, but is it possible to abort a request in e.g. onBeginRequest() method of WebRequestCycle and return an empty response? Adam - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- --- 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Objects.cloneObject
We already have something implemented that classes can be loaded from other places:// This overide is required to resolve classess inside in // different // bundle, i.e. // The classess can be resolved by OSGI classresolver // implementation protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { String className = desc.getName(); Application application = Application.get(); IApplicationSettings applicationSettings = application .getApplicationSettings(); IClassResolver classResolver = applicationSettings.getClassResolver(); Class candidate = null; try { candidate = classResolver.resolveClass(className); if (candidate == null) {candidate = super.resolveClass(desc); } } catch (WicketRuntimeException ex) { if (ex.getCause () instanceof ClassNotFoundException) {throw (ClassNotFoundException)ex.getCause(); } } return candidate; }So we could do there some extra steps i takeWhen the class is still not found do object.getClassLoader().loadClass(className)johan On 7/11/06, Ittay Dror [EMAIL PROTECTED] wrote: If i try to clone an object that is not in the ClassLoader of the wicket jar, this will fail on ClassNotFoundI don't know enough about serialization, but is there a way to use object.getClassLoader to do the deserialization? Thanks,ittay--===Ittay Dror,Chief architect, openQRM TL,RD, Qlusters Inc.[EMAIL PROTECTED]+972-3-6081994 Fax: +972-3-6081841 http://www.openQRM.org- Keeps your Data-Center Up and Running-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 easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] SSL
The code had a small little fix:There is an extra condition in the if condition: else if( pageClass != null httpServletRequest.isSecure () !isSecurityRequired ) {Using the ONE_PASS method rendering strategy everything works fine now. Did you have to do the same?Yes had to use the One pass rendering strategy else there was an error saying something about double calls. I dont remeber the actual error now.Shams - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user