Hello,
I built a stateless website using Bookmarkable pages and links. I have a
base page with a search form (StatelessForm) which all the other pages
(bookmarkable) extend to share this form and some other tabs (Home, Links,
etc). My problem is that if this search box is on AbcPage or XyzPage, on
submit the pageparameters are forwarded to AbcPage first and then redirected
to SearchResultsPage. But, since pageparameters validation fails on
AbcPage/XyzPage, I get an exception and the further redirect gives an error
too. Is there a way to go straight to SearchResultsPage without going
through the current AbcPage? I am using latest wicket distribution
(apache-wicket-1.4.16). I have been trying to figure out this for days, so I
would really appreciate any help!
HTML ---
Search:
Advanced Search
Java ---
final StatelessForm form = new StatelessForm("Search", new
CompoundPropertyModel(fSearch))
{
@Override
protected void onSubmit()
{
if(sLogger.isInfoEnabled())
{
sLogger.info(fSearch.toString());
}
setResponsePage(SearchResultsPage.class,
fSearch.toPageParameters());
//setRedirect(false);
}
};
// Add the search box to the form
form.add(new TextField("SearchValue"));
form.add(new BookmarkablePageLink("advancedSearch",
AdvancedSearchPage.class));
fParentComponent.add(form);
Webpage ERROR:
HTTP Status 404 -
type Status report
message
description The requested resource () is not available.
Server ERROR:
2011-03-25 12:53:51.0349 ERROR http-8080-3 index.AbcPage - Exception
java.lang.NullPointerException
at index.AbcPage.validateParams(AbcPage.java:258)
at index.AbcPage.(AbcPage.java:86)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:89)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:306)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:321)
at
org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:126)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1241)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1320)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
I tried mounting the page and supplying the url in action attribute but that
didn't work either.
Thank you!
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/StatelessForm-redirect-tp3406282p3406282.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]