[Wicket-user] How to append an # anchor to an href?
I want a hyperlink to take me to a particular section of another page. If I was doing static HTML, the link would be something like . I can't figure out how to do this with wicket... Here's my code: add( new Link("up") { public void onClick() { setResponsePage( new List() ); } } ); I see the setAnchor() method on Link, but that looks like it's more for linking to a component on the same page. In this case, I want to link to a certain spot on a page that has not been instantiated at the time the first page is rendered. I guess what I'm really looking for is something like aLink.setAnchorName("sectionName"); --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ IMPORTANT NOTICE: This mailing list is shutting down. Please subscribe to the Apache Wicket user list. Send a message to: "users-subscribe at wicket.apache.org" and follow the instructions. ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] 401 HTTP authentication?
Sean, Jean-Baptiste, Johan, Maurce, thanks for all of your help. I ended up using a combination of all suggestions, which worked well. Here's the final code in my Application class in case it's useful to anybody else: protected void init() { super.init(); getSecuritySettings().setAuthorizationStrategy( new IAuthorizationStrategy() { public boolean isInstantiationAuthorized( Class componentClass ) { if( componentClass.getName().startsWith("wicket") ) { return true; //Allow wicket error messages to be displayed } try { boolean isAuthenticated = false; HttpServletRequest request = ((WebRequest)RequestCycle.get ().getRequest()).getHttpServletRequest(); String auth = request.getHeader("Authorization"); if (auth != null && auth.indexOf(' ') != -1) { // a valid auth header will have the type of auth, then a space, then the data auth = auth.substring(auth.indexOf(' ') + 1); auth = new String( new BASE64Decoder().decodeBuffer( auth ) ); int index = auth.indexOf(':'); if (index != -1) { String username = auth.substring(0, index); String password = auth.substring(index+1); isAuthenticated = authenticate( username, password ); } } return isAuthenticated; } catch( IOException e ) { throw new RuntimeException( e ); } } private boolean authenticate( String username, String password ) { //Authenticate here } public boolean isActionAuthorized( Component component, Action action ) { return true; } } ); getSecuritySettings().setUnauthorizedComponentInstantiationListener ( new IUnauthorizedComponentInstantiationListener() { public void onUnauthorizedInstantiation( Component component ) { HttpServletResponse response = ((WebResponse)component.getResponse ()).getHttpServletResponse(); response.setHeader("WWW-Authenticate", "Basic realm=\"" + getRealm () + "\""); throw new AbortWithHttpStatusException( 401, false ); } private String getRealm() { return "YourSecurityRealm"; } } ); } --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 On Jul 7, 2007, at 12:27 AM, Sean Sullivan wrote: > > Have you tried: > > import org.apache.wicket.protocol.http.servlet.*; > > > throw new AbortWithWebErrorCodeException(401) > > // or maybe: > > throw new AbortWithHttpStatusException(401, false) > > > > On 7/3/07, Maurice Marrink <[EMAIL PROTECTED] > wrote: > > > I did some digging in the code and found the following: using the > RequestCycle you can get the Response. which is most likely a > WebResponse from there you can get the HttpServletResponse and set the > statuscode to 401. Question remains how to tell wicket to stop > processing and simply return the statuscode. > -- > --- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] 401 HTTP authentication?
What is the right way to use basic HTTP authentication? I know how to read the headers to extract the username and password, but if they don't match, or if they're not supplied, what is the best way to send the 401 response to the user? It seems like the ISecuritySettings.setUnauthorizedComponentInstantiationListener() method assumes that you want to present an HTML login component to the user. --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Difficulty with TextFields in ListView
Thanks, that's what I needed. --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 On Apr 24, 2007, at 8:53 AM, Martijn Dashorst wrote: > Sorry to make a short note: > http://cwiki.apache.org/WICKET/listview-and-other-repeaters.html > > Basically you need to setReuseItems(true) or use a repeater. > > Martijn > > > On 4/24/07, Jesse Barnum <[EMAIL PROTECTED]> wrote: >> This example renders correctly, but every time I edit one of the >> values and hit the submit button, the TextFields are reverting to >> their initial value. The desired behavior is that the 'strings' list >> will be updated with whatever I enter into the text fields. What am I >> doing wrong? I am using Wicket 1.2.5. >> >> --- ListViewForm.java --- >> package com.prosc.test; >> >> import wicket.markup.html.WebPage; >> import wicket.markup.html.form.TextField; >> import wicket.markup.html.form.Form; >> import wicket.markup.html.list.ListView; >> import wicket.markup.html.list.ListItem; >> import wicket.model.Model; >> >> import java.util.List; >> import java.util.LinkedList; >> import java.util.Arrays; >> >> public class ListViewForm extends WebPage { >> String[] names = {"Jesse", "Lisa", "Sam"}; >> List strings = new LinkedList( Arrays.asList(names) ); >> >> public ListViewForm() { >> Form form = new Form( "form" ); >> form.add( new ListView("names", strings) { >> protected void populateItem( final >> ListItem item ) { >> String eachName = >> item.getModelObjectAsString(); >> item.add( new TextField >> ("eachName", new Model(eachName) ) ); >> } >> } ); >> add( form ); >> } >> } >> >> --- ListViewForm.html --- >> >> >> >> >> >> > wicket:id="eachName" /> >> >> >> >> >> >> >> >> >> >> --Jesse Barnum, President, 360Works >> http://www.360works.com >> (770) 234-9293 >> >> >> >> - >> >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> ___ >> Wicket-user mailing list >> Wicket-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wicket-user >> > > > -- > Learn Wicket at ApacheCon Europe: http://apachecon.com > Join the wicket community at irc.freenode.net: ##wicket > Wicket 1.2.6 contains a very important fix. Download Wicket now! > http://wicketframework.org > > -- > --- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Difficulty with TextFields in ListView
This example renders correctly, but every time I edit one of the values and hit the submit button, the TextFields are reverting to their initial value. The desired behavior is that the 'strings' list will be updated with whatever I enter into the text fields. What am I doing wrong? I am using Wicket 1.2.5. --- ListViewForm.java --- package com.prosc.test; import wicket.markup.html.WebPage; import wicket.markup.html.form.TextField; import wicket.markup.html.form.Form; import wicket.markup.html.list.ListView; import wicket.markup.html.list.ListItem; import wicket.model.Model; import java.util.List; import java.util.LinkedList; import java.util.Arrays; public class ListViewForm extends WebPage { String[] names = {"Jesse", "Lisa", "Sam"}; List strings = new LinkedList( Arrays.asList(names) ); public ListViewForm() { Form form = new Form( "form" ); form.add( new ListView("names", strings) { protected void populateItem( final ListItem item ) { String eachName = item.getModelObjectAsString(); item.add( new TextField("eachName", new Model(eachName) ) ); } } ); add( form ); } } --- ListViewForm.html --- --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] CheckGroup example
I can't find an example of how to use CheckGroup. I don't know which HTML element to associate it with. I'm trying to do a list of items in a form, like this: Item 1 Item 2 Item 3 The docs for CheckGroup tell me that I need to add it in the hierarchy above the Check items, but where would that be in this example? --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Dumb question about serialization
Sorry for the dumb question, but I don't see any overview documentation talking about models and serialization in the API. Is there any way to not have to serialize objects in a model? I don't need support for back button / undo / etc. I have some objects that cannot be serialized which need to be displayed in a ListView, and when I try to modify the contents of the ListView, it causes exceptions because it automatically tries to serialize everything which I call modelChanging(). Is there a setting I can change somewhere to run everything in memory? --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Download link for 1.2.x is broken
I'm trying to download the snapshot jars of Wicket 1.2.x from this page: http://incubator.apache.org/wicket/getting-wicket.html#GettingWicket- wicket125 When I click on the snapshot repository URL ( http://wicketstuff.org/ maven/repository ), I get an error that I cannot connect to the server. I do not use Maven, so I can't build from source code. --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] WAP interfaces?
Could I use Wicket to build a WAP site, or is it exclusively for HTML? --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] low wicket performance - intensive file system usage
So it's not in any pre-compiled release version? --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 On Feb 13, 2007, at 5:59 PM, Eelco Hillenius wrote: > On 2/13/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: >> in 1.x or 2.x > > Where 1.x stands for the name for the branch and Wicket version 1.3 > and up. > > Eelco > > -- > --- > 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 > ___ > 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=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] low wicket performance - intensive file system usage
I don't have a WicketFilter in my wicket-1.2.5.jar. Where would I find this? --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 On Feb 13, 2007, at 8:48 AM, Martijn Dashorst wrote: > Use the wicket filter instead. > > Martijn > > On 2/13/07, Andrew Klochkov <[EMAIL PROTECTED]> wrote: >> I think I found the cause of our performance problems - we map wicket >> servlet to /*. If I change it to "/app", things become much much >> faster. >> The problem is that our customer doesn't want to have redirect on the >> main page, and at the same time this page is not static. Any >> suggestions? >> >> Matej Knopp wrote: >>> This is very strange. >>> We are know about the FilePageStore.storePage performance issues and >>> johan is working on optimizing that. >>> >>> but CompressedPackageResource shouldn't take 30%. Definitely not. >>> caches >>> the resource so the serving should be immediate. Unless your machine >>> runs out of memory, in that case the cache is evicted. >>> >>> I'm not sure but i think there was a memory leak in 1.x lately, >>> are you >>> sure you're using the latest version? >>> >>> What's the configuration of your server? >>> >>> Btw. You can try to use HttpSessionStore to see if it makes serving >>> pages faster >>> >>> (in your application class >>> protected ISessionStore newSessionStore() { >>> return new HttpSessionStore(); >>> } >>> ) >>> >>> -Matej >>> >>> Andrew Klochkov wrote: >>> >>>> forgot to mention the version - we use wicket 1.3 >>>> >>>> Andrew Klochkov wrote: >>>> >>>>> Hi >>>>> >>>>> Recently we launched some simple webapp written in wicket, but >>>>> performance is obviously low. Even simple pages are being >>>>> loaded too slow. >>>>> I tried to dig into it using profiler and found out that wicket >>>>> takes >>>>> 67% of CPU to work with file system. Main points of low >>>>> performance are: >>>>> >>>>> 1. wicket.protocol.http.FilePageStore.storePage eats 25% of CPU >>>>> 2. getting resources using CompressedPackageResource eats 30% >>>>> of CPU >>>>> >>>>> How can we improve it? Why does wicket save all the pages in >>>>> files, why >>>>> not to use http sessions? >>>>> And what can be done with resources? I guess the browser >>>>> doesn't cache >>>>> them and it takes to long time to get them from jars. >>>>> >>>>> >>>>> >>>> >>> >>> >>> >>> - >>> 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 >>> ___ >>> Wicket-user mailing list >>> Wicket-user@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/wicket-user >>> >>> >>> >> >> >> -- >> Andrew Klochkov >> >> >> - >> >> 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 >> ___ >> Wicket-user mailing list >> Wicket-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wicket-user >> > > > -- > Vote for Wicket at the http://www.thebeststuffintheworld.com/ > vote_for/wicket > Wicket 1.2.4 is as easy as 1-2-4. Download Wicket now! > http://wicketframework.org > > -- > --- > 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 > ___ > 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=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Convert newlines to br
Thank you, that's just what I needed. Hopefully someday I'll be able to help answer questions on this list instead of just asking them! --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 On Feb 12, 2007, at 6:28 PM, Eelco Hillenius wrote: > See MultiLineLabel or Strings.toMultilineMarkup > > Eelco > > On 2/12/07, Jesse Barnum <[EMAIL PROTECTED]> wrote: >> How can I tell a Label to convert newlines to HTML linebreaks? >> >> So that "first line\nSecond line" would become "first lineSecond >> line"? >> >> It seems like there ought to be a Component.setConvertNewlines(true) >> or something similar, or maybe this should happen when you >> setEscapeModelStrings( true ); >> >> --Jesse Barnum, President, 360Works >> http://www.360works.com >> (770) 234-9293 >> >> >> >> - >> >> 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 >> ___ >> 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=lnk&kid=120709&bid=263057&dat=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=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Convert newlines to br
How can I tell a Label to convert newlines to HTML linebreaks? So that "first line\nSecond line" would become "first lineSecond line"? It seems like there ought to be a Component.setConvertNewlines(true) or something similar, or maybe this should happen when you setEscapeModelStrings( true ); --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 - 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 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Hotswap application
I am trying to develop with Wicket in IntelliJ. Whenever I do a hotswap on some code changes, it seems like IntelliJ / Tomcat automatically redeploys the application and I get a 'Page Expired' error. Is there any way for me to run the app in debugger mode, make changes to methods, recompile/hotswap, and then immediately see my changes in the web browser? --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 - 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 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user