You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "mailinglist@jorgenpersson.se" <ma...@jorgenpersson.se> on 2008/02/18 22:56:27 UTC
Form.getMethod() throws Exception
Hello all.
When calling the getMethod from a subclass of a Form component an
exception is thrown.
When looking in the code I see the following comment just before the
exception is thrown in Component.java:
// This should never happen since Page always has associated markup
If I out comment this call then my app runs like a charm :), so this
looks like a bug to me. Is this a known problem?
org.apache.wicket.WicketRuntimeException: Unable to find parent with associated markup
at org.apache.wicket.Component.findParentWithAssociatedMarkup(Component.java:1218)
at org.apache.wicket.MarkupFragmentFinder.find(MarkupFragmentFinder.java:50)
at org.apache.wicket.Component.locateMarkupStream(Component.java:3614)
at org.apache.wicket.Component.getMarkupAttributes(Component.java:1359)
at org.apache.wicket.markup.html.form.Form.getMethod(Form.java:1378)
at se.jorgenpersson.web.manager.TemplateManagement$ListTemplateForm.<init>(TemplateManagement.java:54)
at se.jorgenpersson.web.manager.TemplateManagement.<init>(TemplateManagement.java:28)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:90)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:121)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Form.getMethod() throws Exception
Posted by "mailinglist@jorgenpersson.se" <ma...@jorgenpersson.se>.
Ah. Thank you very much.
/Jörgen
Martijn Dashorst skrev:
> Remember: Wicket is a stateful framework, so you don't have to apply
> REST-like stuff. if you don't want to.
>
> setResponsePage(new MySuperSecretHidingPage(supersecretpassword));
>
> with:
>
> public class MySuperSecretHidingPage extends WebPage {
> public MySuperSecretHidingPage(String password) {
> }
> }
>
> will work just fine for your purposes.
>
> Martijn
>
> On 2/19/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se> wrote:
>
>> Sorry that I was not clear enough.
>>
>> Even though I have a specific scenario in my application, the question
>> is more general. Let me rephrase what I'm after.
>> I want to avoid whatever parameters I submit to my response page from
>> being displayed in the browsers url field.
>>
>> For instance, if my submit method contains
>>
>> setResponsePage(ResponsePage.class, new
>> PageParameters("password=NotSoSecret"));
>>
>> I will see
>> http://<myserver>/<webapp>/html/ResponsePage/password/NotSoSecret in the
>> browser when the response page has been loaded.
>>
>> Hope this was a little bit clearer.
>>
>> /Jörgen
>>
>> Martijn Dashorst skrev:
>>
>>> I don't understand what you are trying to achieve.
>>>
>>> setResponsePage goes to another page. If you don't want to go to
>>> another page, then don't set response page.
>>>
>>> Martijn
>>>
>>> On 2/18/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se> wrote:
>>>
>>>
>>>> Ah, so I was half correct ;)
>>>>
>>>> What is the best practice to get around this? Should I store my
>>>> parameters in my Session class and pick them up again when in
>>>> MyResponseClass?
>>>>
>>>> And one more thing. Sorry for not signing my earlier mails.
>>>>
>>>> Thanks for your help.
>>>>
>>>> BR,
>>>> Jörgen
>>>>
>>>>
>>>> Henrik Lundahl skrev:
>>>>
>>>>
>>>>> Hi
>>>>>
>>>>> The parameters are left out of the request URL in the request that brings
>>>>> you to the onSubmit method, but the response URL will contain the
>>>>> PageParameters you set for the MyResponseClass page.
>>>>>
>>>>>
>>>>> BR,
>>>>> Henrik Lundahl
>>>>>
>>>>>
>>>>>
>>>>> 2008/2/18, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se>:
>>>>>
>>>>>
>>>>>
>>>>>> Hello.
>>>>>>
>>>>>> It was just for debugging purposes.
>>>>>>
>>>>>> I wanted to see if I used GET or POST. I know from the code that POST is
>>>>>> used as default (unless stated otherwise in the markup), but I just
>>>>>> wanted it confirmed.
>>>>>>
>>>>>> With my very limited (next to nothing) knowledge about web coding in
>>>>>> general I thought that when using POST any parameter passed on is not
>>>>>> shown in the URL. This is however the case when I submit using
>>>>>>
>>>>>> ...
>>>>>> onSubmit(){
>>>>>> mySumbitButton.setResponsePage(MyResponseClass.class, new
>>>>>> PageParameters("myKey=myValue"));
>>>>>> }
>>>>>> ...
>>>>>>
>>>>>>
>>>>>> Martijn Dashorst skrev:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Don't call this method in a constructor. The component isn't added to
>>>>>>> the page yet, and therefore doesn't know its markup causing it to fail
>>>>>>> to find the method="foo" tag.
>>>>>>>
>>>>>>> Why do you want to call this method in a constructor?
>>>>>>>
>>>>>>> Martijn
>>>>>>>
>>>>>>> On 2/18/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> Hello all.
>>>>>>>>
>>>>>>>> When calling the getMethod from a subclass of a Form component an
>>>>>>>> exception is thrown.
>>>>>>>> When looking in the code I see the following comment just before the
>>>>>>>> exception is thrown in Component.java:
>>>>>>>> // This should never happen since Page always has associated markup
>>>>>>>>
>>>>>>>> If I out comment this call then my app runs like a charm :), so this
>>>>>>>> looks like a bug to me. Is this a known problem?
>>>>>>>>
>>>>>>>> org.apache.wicket.WicketRuntimeException: Unable to find parent with
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> associated markup
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.wicket.Component.findParentWithAssociatedMarkup(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> Component.java:1218)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.wicket.MarkupFragmentFinder.find(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> MarkupFragmentFinder.java:50)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.wicket.Component.locateMarkupStream(Component.java
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> :3614)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.wicket.Component.getMarkupAttributes(Component.java
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> :1359)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.wicket.markup.html.form.Form.getMethod(Form.java
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> :1378)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> se.jorgenpersson.web.manager.TemplateManagement$ListTemplateForm.<init>(
>>>>>> TemplateManagement.java:54)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at se.jorgenpersson.web.manager.TemplateManagement.<init>(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> TemplateManagement.java:28)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>>>>>>> at java.lang.Class.newInstance0(Class.java:355)
>>>>>>>> at java.lang.Class.newInstance(Class.java:308)
>>>>>>>> at org.apache.wicket.session.DefaultPageFactory.newPage(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> DefaultPageFactory.java:58)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage
>>>>>> (BookmarkablePageRequestTarget.java:262)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage
>>>>>> (BookmarkablePageRequestTarget.java:283)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents
>>>>>> (BookmarkablePageRequestTarget.java:210)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
>>>>>> AbstractRequestCycleProcessor.java:90)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.wicket.RequestCycle.processEventsAndRespond(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> RequestCycle.java:1166)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
>>>>>>>> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
>>>>>>>> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>>>>>>>> at org.apache.wicket.protocol.http.WicketFilter.doGet(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> WicketFilter.java:354)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.wicket.protocol.http.WicketServlet.doGet(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> WicketServlet.java:121)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>>>>>> at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>>>>>> ApplicationFilterChain.java:290)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> ApplicationFilterChain.java:206)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.catalina.core.StandardWrapperValve.invoke(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> StandardWrapperValve.java:233)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.catalina.core.StandardContextValve.invoke(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> StandardContextValve.java:175)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.catalina.core.StandardHostValve.invoke(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> StandardHostValve.java:128)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.catalina.valves.ErrorReportValve.invoke(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> ErrorReportValve.java:102)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.catalina.core.StandardEngineValve.invoke(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> StandardEngineValve.java:109)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.catalina.connector.CoyoteAdapter.service(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> CoyoteAdapter.java:263)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.coyote.http11.Http11Processor.process(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> Http11Processor.java:844)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
>>>>>> Http11Protocol.java:584)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> JIoEndpoint.java:447)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Form.getMethod() throws Exception
Posted by Martijn Dashorst <ma...@gmail.com>.
Remember: Wicket is a stateful framework, so you don't have to apply
REST-like stuff. if you don't want to.
setResponsePage(new MySuperSecretHidingPage(supersecretpassword));
with:
public class MySuperSecretHidingPage extends WebPage {
public MySuperSecretHidingPage(String password) {
}
}
will work just fine for your purposes.
Martijn
On 2/19/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se> wrote:
> Sorry that I was not clear enough.
>
> Even though I have a specific scenario in my application, the question
> is more general. Let me rephrase what I'm after.
> I want to avoid whatever parameters I submit to my response page from
> being displayed in the browsers url field.
>
> For instance, if my submit method contains
>
> setResponsePage(ResponsePage.class, new
> PageParameters("password=NotSoSecret"));
>
> I will see
> http://<myserver>/<webapp>/html/ResponsePage/password/NotSoSecret in the
> browser when the response page has been loaded.
>
> Hope this was a little bit clearer.
>
> /Jörgen
>
> Martijn Dashorst skrev:
> > I don't understand what you are trying to achieve.
> >
> > setResponsePage goes to another page. If you don't want to go to
> > another page, then don't set response page.
> >
> > Martijn
> >
> > On 2/18/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se> wrote:
> >
> >> Ah, so I was half correct ;)
> >>
> >> What is the best practice to get around this? Should I store my
> >> parameters in my Session class and pick them up again when in
> >> MyResponseClass?
> >>
> >> And one more thing. Sorry for not signing my earlier mails.
> >>
> >> Thanks for your help.
> >>
> >> BR,
> >> Jörgen
> >>
> >>
> >> Henrik Lundahl skrev:
> >>
> >>> Hi
> >>>
> >>> The parameters are left out of the request URL in the request that brings
> >>> you to the onSubmit method, but the response URL will contain the
> >>> PageParameters you set for the MyResponseClass page.
> >>>
> >>>
> >>> BR,
> >>> Henrik Lundahl
> >>>
> >>>
> >>>
> >>> 2008/2/18, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se>:
> >>>
> >>>
> >>>> Hello.
> >>>>
> >>>> It was just for debugging purposes.
> >>>>
> >>>> I wanted to see if I used GET or POST. I know from the code that POST is
> >>>> used as default (unless stated otherwise in the markup), but I just
> >>>> wanted it confirmed.
> >>>>
> >>>> With my very limited (next to nothing) knowledge about web coding in
> >>>> general I thought that when using POST any parameter passed on is not
> >>>> shown in the URL. This is however the case when I submit using
> >>>>
> >>>> ...
> >>>> onSubmit(){
> >>>> mySumbitButton.setResponsePage(MyResponseClass.class, new
> >>>> PageParameters("myKey=myValue"));
> >>>> }
> >>>> ...
> >>>>
> >>>>
> >>>> Martijn Dashorst skrev:
> >>>>
> >>>>
> >>>>> Don't call this method in a constructor. The component isn't added to
> >>>>> the page yet, and therefore doesn't know its markup causing it to fail
> >>>>> to find the method="foo" tag.
> >>>>>
> >>>>> Why do you want to call this method in a constructor?
> >>>>>
> >>>>> Martijn
> >>>>>
> >>>>> On 2/18/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se>
> >>>>>
> >>>>>
> >>>> wrote:
> >>>>
> >>>>
> >>>>>> Hello all.
> >>>>>>
> >>>>>> When calling the getMethod from a subclass of a Form component an
> >>>>>> exception is thrown.
> >>>>>> When looking in the code I see the following comment just before the
> >>>>>> exception is thrown in Component.java:
> >>>>>> // This should never happen since Page always has associated markup
> >>>>>>
> >>>>>> If I out comment this call then my app runs like a charm :), so this
> >>>>>> looks like a bug to me. Is this a known problem?
> >>>>>>
> >>>>>> org.apache.wicket.WicketRuntimeException: Unable to find parent with
> >>>>>>
> >>>>>>
> >>>> associated markup
> >>>>
> >>>>
> >>>>>> at org.apache.wicket.Component.findParentWithAssociatedMarkup(
> >>>>>>
> >>>>>>
> >>>> Component.java:1218)
> >>>>
> >>>>
> >>>>>> at org.apache.wicket.MarkupFragmentFinder.find(
> >>>>>>
> >>>>>>
> >>>> MarkupFragmentFinder.java:50)
> >>>>
> >>>>
> >>>>>> at org.apache.wicket.Component.locateMarkupStream(Component.java
> >>>>>>
> >>>>>>
> >>>> :3614)
> >>>>
> >>>>
> >>>>>> at org.apache.wicket.Component.getMarkupAttributes(Component.java
> >>>>>>
> >>>>>>
> >>>> :1359)
> >>>>
> >>>>
> >>>>>> at org.apache.wicket.markup.html.form.Form.getMethod(Form.java
> >>>>>>
> >>>>>>
> >>>> :1378)
> >>>>
> >>>>
> >>>>>> at
> >>>>>>
> >>>>>>
> >>>> se.jorgenpersson.web.manager.TemplateManagement$ListTemplateForm.<init>(
> >>>> TemplateManagement.java:54)
> >>>>
> >>>>
> >>>>>> at se.jorgenpersson.web.manager.TemplateManagement.<init>(
> >>>>>>
> >>>>>>
> >>>> TemplateManagement.java:28)
> >>>>
> >>>>
> >>>>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> >>>>>> at java.lang.Class.newInstance0(Class.java:355)
> >>>>>> at java.lang.Class.newInstance(Class.java:308)
> >>>>>> at org.apache.wicket.session.DefaultPageFactory.newPage(
> >>>>>>
> >>>>>>
> >>>> DefaultPageFactory.java:58)
> >>>>
> >>>>
> >>>>>> at
> >>>>>>
> >>>>>>
> >>>> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage
> >>>> (BookmarkablePageRequestTarget.java:262)
> >>>>
> >>>>
> >>>>>> at
> >>>>>>
> >>>>>>
> >>>> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage
> >>>> (BookmarkablePageRequestTarget.java:283)
> >>>>
> >>>>
> >>>>>> at
> >>>>>>
> >>>>>>
> >>>> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents
> >>>> (BookmarkablePageRequestTarget.java:210)
> >>>>
> >>>>
> >>>>>> at
> >>>>>>
> >>>>>>
> >>>> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
> >>>> AbstractRequestCycleProcessor.java:90)
> >>>>
> >>>>
> >>>>>> at org.apache.wicket.RequestCycle.processEventsAndRespond(
> >>>>>>
> >>>>>>
> >>>> RequestCycle.java:1166)
> >>>>
> >>>>
> >>>>>> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
> >>>>>> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
> >>>>>> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
> >>>>>> at org.apache.wicket.protocol.http.WicketFilter.doGet(
> >>>>>>
> >>>>>>
> >>>> WicketFilter.java:354)
> >>>>
> >>>>
> >>>>>> at org.apache.wicket.protocol.http.WicketServlet.doGet(
> >>>>>>
> >>>>>>
> >>>> WicketServlet.java:121)
> >>>>
> >>>>
> >>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> >>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>>>>> at
> >>>>>>
> >>>>>>
> >>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> >>>> ApplicationFilterChain.java:290)
> >>>>
> >>>>
> >>>>>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> >>>>>>
> >>>>>>
> >>>> ApplicationFilterChain.java:206)
> >>>>
> >>>>
> >>>>>> at org.apache.catalina.core.StandardWrapperValve.invoke(
> >>>>>>
> >>>>>>
> >>>> StandardWrapperValve.java:233)
> >>>>
> >>>>
> >>>>>> at org.apache.catalina.core.StandardContextValve.invoke(
> >>>>>>
> >>>>>>
> >>>> StandardContextValve.java:175)
> >>>>
> >>>>
> >>>>>> at org.apache.catalina.core.StandardHostValve.invoke(
> >>>>>>
> >>>>>>
> >>>> StandardHostValve.java:128)
> >>>>
> >>>>
> >>>>>> at org.apache.catalina.valves.ErrorReportValve.invoke(
> >>>>>>
> >>>>>>
> >>>> ErrorReportValve.java:102)
> >>>>
> >>>>
> >>>>>> at org.apache.catalina.core.StandardEngineValve.invoke(
> >>>>>>
> >>>>>>
> >>>> StandardEngineValve.java:109)
> >>>>
> >>>>
> >>>>>> at org.apache.catalina.connector.CoyoteAdapter.service(
> >>>>>>
> >>>>>>
> >>>> CoyoteAdapter.java:263)
> >>>>
> >>>>
> >>>>>> at org.apache.coyote.http11.Http11Processor.process(
> >>>>>>
> >>>>>>
> >>>> Http11Processor.java:844)
> >>>>
> >>>>
> >>>>>> at
> >>>>>>
> >>>>>>
> >>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
> >>>> Http11Protocol.java:584)
> >>>>
> >>>>
> >>>>>> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
> >>>>>>
> >>>>>>
> >>>> JIoEndpoint.java:447)
> >>>>
> >>>>
> >>>>>> at java.lang.Thread.run(Thread.java:619)
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >>
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Form.getMethod() throws Exception
Posted by "mailinglist@jorgenpersson.se" <ma...@jorgenpersson.se>.
Sorry that I was not clear enough.
Even though I have a specific scenario in my application, the question
is more general. Let me rephrase what I'm after.
I want to avoid whatever parameters I submit to my response page from
being displayed in the browsers url field.
For instance, if my submit method contains
setResponsePage(ResponsePage.class, new
PageParameters("password=NotSoSecret"));
I will see
http://<myserver>/<webapp>/html/ResponsePage/password/NotSoSecret in the
browser when the response page has been loaded.
Hope this was a little bit clearer.
/Jörgen
Martijn Dashorst skrev:
> I don't understand what you are trying to achieve.
>
> setResponsePage goes to another page. If you don't want to go to
> another page, then don't set response page.
>
> Martijn
>
> On 2/18/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se> wrote:
>
>> Ah, so I was half correct ;)
>>
>> What is the best practice to get around this? Should I store my
>> parameters in my Session class and pick them up again when in
>> MyResponseClass?
>>
>> And one more thing. Sorry for not signing my earlier mails.
>>
>> Thanks for your help.
>>
>> BR,
>> Jörgen
>>
>>
>> Henrik Lundahl skrev:
>>
>>> Hi
>>>
>>> The parameters are left out of the request URL in the request that brings
>>> you to the onSubmit method, but the response URL will contain the
>>> PageParameters you set for the MyResponseClass page.
>>>
>>>
>>> BR,
>>> Henrik Lundahl
>>>
>>>
>>>
>>> 2008/2/18, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se>:
>>>
>>>
>>>> Hello.
>>>>
>>>> It was just for debugging purposes.
>>>>
>>>> I wanted to see if I used GET or POST. I know from the code that POST is
>>>> used as default (unless stated otherwise in the markup), but I just
>>>> wanted it confirmed.
>>>>
>>>> With my very limited (next to nothing) knowledge about web coding in
>>>> general I thought that when using POST any parameter passed on is not
>>>> shown in the URL. This is however the case when I submit using
>>>>
>>>> ...
>>>> onSubmit(){
>>>> mySumbitButton.setResponsePage(MyResponseClass.class, new
>>>> PageParameters("myKey=myValue"));
>>>> }
>>>> ...
>>>>
>>>>
>>>> Martijn Dashorst skrev:
>>>>
>>>>
>>>>> Don't call this method in a constructor. The component isn't added to
>>>>> the page yet, and therefore doesn't know its markup causing it to fail
>>>>> to find the method="foo" tag.
>>>>>
>>>>> Why do you want to call this method in a constructor?
>>>>>
>>>>> Martijn
>>>>>
>>>>> On 2/18/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se>
>>>>>
>>>>>
>>>> wrote:
>>>>
>>>>
>>>>>> Hello all.
>>>>>>
>>>>>> When calling the getMethod from a subclass of a Form component an
>>>>>> exception is thrown.
>>>>>> When looking in the code I see the following comment just before the
>>>>>> exception is thrown in Component.java:
>>>>>> // This should never happen since Page always has associated markup
>>>>>>
>>>>>> If I out comment this call then my app runs like a charm :), so this
>>>>>> looks like a bug to me. Is this a known problem?
>>>>>>
>>>>>> org.apache.wicket.WicketRuntimeException: Unable to find parent with
>>>>>>
>>>>>>
>>>> associated markup
>>>>
>>>>
>>>>>> at org.apache.wicket.Component.findParentWithAssociatedMarkup(
>>>>>>
>>>>>>
>>>> Component.java:1218)
>>>>
>>>>
>>>>>> at org.apache.wicket.MarkupFragmentFinder.find(
>>>>>>
>>>>>>
>>>> MarkupFragmentFinder.java:50)
>>>>
>>>>
>>>>>> at org.apache.wicket.Component.locateMarkupStream(Component.java
>>>>>>
>>>>>>
>>>> :3614)
>>>>
>>>>
>>>>>> at org.apache.wicket.Component.getMarkupAttributes(Component.java
>>>>>>
>>>>>>
>>>> :1359)
>>>>
>>>>
>>>>>> at org.apache.wicket.markup.html.form.Form.getMethod(Form.java
>>>>>>
>>>>>>
>>>> :1378)
>>>>
>>>>
>>>>>> at
>>>>>>
>>>>>>
>>>> se.jorgenpersson.web.manager.TemplateManagement$ListTemplateForm.<init>(
>>>> TemplateManagement.java:54)
>>>>
>>>>
>>>>>> at se.jorgenpersson.web.manager.TemplateManagement.<init>(
>>>>>>
>>>>>>
>>>> TemplateManagement.java:28)
>>>>
>>>>
>>>>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>>>>> at java.lang.Class.newInstance0(Class.java:355)
>>>>>> at java.lang.Class.newInstance(Class.java:308)
>>>>>> at org.apache.wicket.session.DefaultPageFactory.newPage(
>>>>>>
>>>>>>
>>>> DefaultPageFactory.java:58)
>>>>
>>>>
>>>>>> at
>>>>>>
>>>>>>
>>>> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage
>>>> (BookmarkablePageRequestTarget.java:262)
>>>>
>>>>
>>>>>> at
>>>>>>
>>>>>>
>>>> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage
>>>> (BookmarkablePageRequestTarget.java:283)
>>>>
>>>>
>>>>>> at
>>>>>>
>>>>>>
>>>> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents
>>>> (BookmarkablePageRequestTarget.java:210)
>>>>
>>>>
>>>>>> at
>>>>>>
>>>>>>
>>>> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
>>>> AbstractRequestCycleProcessor.java:90)
>>>>
>>>>
>>>>>> at org.apache.wicket.RequestCycle.processEventsAndRespond(
>>>>>>
>>>>>>
>>>> RequestCycle.java:1166)
>>>>
>>>>
>>>>>> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
>>>>>> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
>>>>>> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>>>>>> at org.apache.wicket.protocol.http.WicketFilter.doGet(
>>>>>>
>>>>>>
>>>> WicketFilter.java:354)
>>>>
>>>>
>>>>>> at org.apache.wicket.protocol.http.WicketServlet.doGet(
>>>>>>
>>>>>>
>>>> WicketServlet.java:121)
>>>>
>>>>
>>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>>>> at
>>>>>>
>>>>>>
>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>>>> ApplicationFilterChain.java:290)
>>>>
>>>>
>>>>>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
>>>>>>
>>>>>>
>>>> ApplicationFilterChain.java:206)
>>>>
>>>>
>>>>>> at org.apache.catalina.core.StandardWrapperValve.invoke(
>>>>>>
>>>>>>
>>>> StandardWrapperValve.java:233)
>>>>
>>>>
>>>>>> at org.apache.catalina.core.StandardContextValve.invoke(
>>>>>>
>>>>>>
>>>> StandardContextValve.java:175)
>>>>
>>>>
>>>>>> at org.apache.catalina.core.StandardHostValve.invoke(
>>>>>>
>>>>>>
>>>> StandardHostValve.java:128)
>>>>
>>>>
>>>>>> at org.apache.catalina.valves.ErrorReportValve.invoke(
>>>>>>
>>>>>>
>>>> ErrorReportValve.java:102)
>>>>
>>>>
>>>>>> at org.apache.catalina.core.StandardEngineValve.invoke(
>>>>>>
>>>>>>
>>>> StandardEngineValve.java:109)
>>>>
>>>>
>>>>>> at org.apache.catalina.connector.CoyoteAdapter.service(
>>>>>>
>>>>>>
>>>> CoyoteAdapter.java:263)
>>>>
>>>>
>>>>>> at org.apache.coyote.http11.Http11Processor.process(
>>>>>>
>>>>>>
>>>> Http11Processor.java:844)
>>>>
>>>>
>>>>>> at
>>>>>>
>>>>>>
>>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
>>>> Http11Protocol.java:584)
>>>>
>>>>
>>>>>> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
>>>>>>
>>>>>>
>>>> JIoEndpoint.java:447)
>>>>
>>>>
>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Form.getMethod() throws Exception
Posted by Martijn Dashorst <ma...@gmail.com>.
I don't understand what you are trying to achieve.
setResponsePage goes to another page. If you don't want to go to
another page, then don't set response page.
Martijn
On 2/18/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se> wrote:
> Ah, so I was half correct ;)
>
> What is the best practice to get around this? Should I store my
> parameters in my Session class and pick them up again when in
> MyResponseClass?
>
> And one more thing. Sorry for not signing my earlier mails.
>
> Thanks for your help.
>
> BR,
> Jörgen
>
>
> Henrik Lundahl skrev:
> > Hi
> >
> > The parameters are left out of the request URL in the request that brings
> > you to the onSubmit method, but the response URL will contain the
> > PageParameters you set for the MyResponseClass page.
> >
> >
> > BR,
> > Henrik Lundahl
> >
> >
> >
> > 2008/2/18, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se>:
> >
> >> Hello.
> >>
> >> It was just for debugging purposes.
> >>
> >> I wanted to see if I used GET or POST. I know from the code that POST is
> >> used as default (unless stated otherwise in the markup), but I just
> >> wanted it confirmed.
> >>
> >> With my very limited (next to nothing) knowledge about web coding in
> >> general I thought that when using POST any parameter passed on is not
> >> shown in the URL. This is however the case when I submit using
> >>
> >> ...
> >> onSubmit(){
> >> mySumbitButton.setResponsePage(MyResponseClass.class, new
> >> PageParameters("myKey=myValue"));
> >> }
> >> ...
> >>
> >>
> >> Martijn Dashorst skrev:
> >>
> >>> Don't call this method in a constructor. The component isn't added to
> >>> the page yet, and therefore doesn't know its markup causing it to fail
> >>> to find the method="foo" tag.
> >>>
> >>> Why do you want to call this method in a constructor?
> >>>
> >>> Martijn
> >>>
> >>> On 2/18/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se>
> >>>
> >> wrote:
> >>
> >>>> Hello all.
> >>>>
> >>>> When calling the getMethod from a subclass of a Form component an
> >>>> exception is thrown.
> >>>> When looking in the code I see the following comment just before the
> >>>> exception is thrown in Component.java:
> >>>> // This should never happen since Page always has associated markup
> >>>>
> >>>> If I out comment this call then my app runs like a charm :), so this
> >>>> looks like a bug to me. Is this a known problem?
> >>>>
> >>>> org.apache.wicket.WicketRuntimeException: Unable to find parent with
> >>>>
> >> associated markup
> >>
> >>>> at org.apache.wicket.Component.findParentWithAssociatedMarkup(
> >>>>
> >> Component.java:1218)
> >>
> >>>> at org.apache.wicket.MarkupFragmentFinder.find(
> >>>>
> >> MarkupFragmentFinder.java:50)
> >>
> >>>> at org.apache.wicket.Component.locateMarkupStream(Component.java
> >>>>
> >> :3614)
> >>
> >>>> at org.apache.wicket.Component.getMarkupAttributes(Component.java
> >>>>
> >> :1359)
> >>
> >>>> at org.apache.wicket.markup.html.form.Form.getMethod(Form.java
> >>>>
> >> :1378)
> >>
> >>>> at
> >>>>
> >> se.jorgenpersson.web.manager.TemplateManagement$ListTemplateForm.<init>(
> >> TemplateManagement.java:54)
> >>
> >>>> at se.jorgenpersson.web.manager.TemplateManagement.<init>(
> >>>>
> >> TemplateManagement.java:28)
> >>
> >>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> >>>> at java.lang.Class.newInstance0(Class.java:355)
> >>>> at java.lang.Class.newInstance(Class.java:308)
> >>>> at org.apache.wicket.session.DefaultPageFactory.newPage(
> >>>>
> >> DefaultPageFactory.java:58)
> >>
> >>>> at
> >>>>
> >> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage
> >> (BookmarkablePageRequestTarget.java:262)
> >>
> >>>> at
> >>>>
> >> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage
> >> (BookmarkablePageRequestTarget.java:283)
> >>
> >>>> at
> >>>>
> >> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents
> >> (BookmarkablePageRequestTarget.java:210)
> >>
> >>>> at
> >>>>
> >> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
> >> AbstractRequestCycleProcessor.java:90)
> >>
> >>>> at org.apache.wicket.RequestCycle.processEventsAndRespond(
> >>>>
> >> RequestCycle.java:1166)
> >>
> >>>> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
> >>>> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
> >>>> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
> >>>> at org.apache.wicket.protocol.http.WicketFilter.doGet(
> >>>>
> >> WicketFilter.java:354)
> >>
> >>>> at org.apache.wicket.protocol.http.WicketServlet.doGet(
> >>>>
> >> WicketServlet.java:121)
> >>
> >>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> >>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>>> at
> >>>>
> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> >> ApplicationFilterChain.java:290)
> >>
> >>>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> >>>>
> >> ApplicationFilterChain.java:206)
> >>
> >>>> at org.apache.catalina.core.StandardWrapperValve.invoke(
> >>>>
> >> StandardWrapperValve.java:233)
> >>
> >>>> at org.apache.catalina.core.StandardContextValve.invoke(
> >>>>
> >> StandardContextValve.java:175)
> >>
> >>>> at org.apache.catalina.core.StandardHostValve.invoke(
> >>>>
> >> StandardHostValve.java:128)
> >>
> >>>> at org.apache.catalina.valves.ErrorReportValve.invoke(
> >>>>
> >> ErrorReportValve.java:102)
> >>
> >>>> at org.apache.catalina.core.StandardEngineValve.invoke(
> >>>>
> >> StandardEngineValve.java:109)
> >>
> >>>> at org.apache.catalina.connector.CoyoteAdapter.service(
> >>>>
> >> CoyoteAdapter.java:263)
> >>
> >>>> at org.apache.coyote.http11.Http11Processor.process(
> >>>>
> >> Http11Processor.java:844)
> >>
> >>>> at
> >>>>
> >> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
> >> Http11Protocol.java:584)
> >>
> >>>> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
> >>>>
> >> JIoEndpoint.java:447)
> >>
> >>>> at java.lang.Thread.run(Thread.java:619)
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Form.getMethod() throws Exception
Posted by "mailinglist@jorgenpersson.se" <ma...@jorgenpersson.se>.
Ah, so I was half correct ;)
What is the best practice to get around this? Should I store my
parameters in my Session class and pick them up again when in
MyResponseClass?
And one more thing. Sorry for not signing my earlier mails.
Thanks for your help.
BR,
Jörgen
Henrik Lundahl skrev:
> Hi
>
> The parameters are left out of the request URL in the request that brings
> you to the onSubmit method, but the response URL will contain the
> PageParameters you set for the MyResponseClass page.
>
>
> BR,
> Henrik Lundahl
>
>
>
> 2008/2/18, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se>:
>
>> Hello.
>>
>> It was just for debugging purposes.
>>
>> I wanted to see if I used GET or POST. I know from the code that POST is
>> used as default (unless stated otherwise in the markup), but I just
>> wanted it confirmed.
>>
>> With my very limited (next to nothing) knowledge about web coding in
>> general I thought that when using POST any parameter passed on is not
>> shown in the URL. This is however the case when I submit using
>>
>> ...
>> onSubmit(){
>> mySumbitButton.setResponsePage(MyResponseClass.class, new
>> PageParameters("myKey=myValue"));
>> }
>> ...
>>
>>
>> Martijn Dashorst skrev:
>>
>>> Don't call this method in a constructor. The component isn't added to
>>> the page yet, and therefore doesn't know its markup causing it to fail
>>> to find the method="foo" tag.
>>>
>>> Why do you want to call this method in a constructor?
>>>
>>> Martijn
>>>
>>> On 2/18/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se>
>>>
>> wrote:
>>
>>>> Hello all.
>>>>
>>>> When calling the getMethod from a subclass of a Form component an
>>>> exception is thrown.
>>>> When looking in the code I see the following comment just before the
>>>> exception is thrown in Component.java:
>>>> // This should never happen since Page always has associated markup
>>>>
>>>> If I out comment this call then my app runs like a charm :), so this
>>>> looks like a bug to me. Is this a known problem?
>>>>
>>>> org.apache.wicket.WicketRuntimeException: Unable to find parent with
>>>>
>> associated markup
>>
>>>> at org.apache.wicket.Component.findParentWithAssociatedMarkup(
>>>>
>> Component.java:1218)
>>
>>>> at org.apache.wicket.MarkupFragmentFinder.find(
>>>>
>> MarkupFragmentFinder.java:50)
>>
>>>> at org.apache.wicket.Component.locateMarkupStream(Component.java
>>>>
>> :3614)
>>
>>>> at org.apache.wicket.Component.getMarkupAttributes(Component.java
>>>>
>> :1359)
>>
>>>> at org.apache.wicket.markup.html.form.Form.getMethod(Form.java
>>>>
>> :1378)
>>
>>>> at
>>>>
>> se.jorgenpersson.web.manager.TemplateManagement$ListTemplateForm.<init>(
>> TemplateManagement.java:54)
>>
>>>> at se.jorgenpersson.web.manager.TemplateManagement.<init>(
>>>>
>> TemplateManagement.java:28)
>>
>>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>>> at java.lang.Class.newInstance0(Class.java:355)
>>>> at java.lang.Class.newInstance(Class.java:308)
>>>> at org.apache.wicket.session.DefaultPageFactory.newPage(
>>>>
>> DefaultPageFactory.java:58)
>>
>>>> at
>>>>
>> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage
>> (BookmarkablePageRequestTarget.java:262)
>>
>>>> at
>>>>
>> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage
>> (BookmarkablePageRequestTarget.java:283)
>>
>>>> at
>>>>
>> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents
>> (BookmarkablePageRequestTarget.java:210)
>>
>>>> at
>>>>
>> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
>> AbstractRequestCycleProcessor.java:90)
>>
>>>> at org.apache.wicket.RequestCycle.processEventsAndRespond(
>>>>
>> RequestCycle.java:1166)
>>
>>>> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
>>>> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
>>>> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>>>> at org.apache.wicket.protocol.http.WicketFilter.doGet(
>>>>
>> WicketFilter.java:354)
>>
>>>> at org.apache.wicket.protocol.http.WicketServlet.doGet(
>>>>
>> WicketServlet.java:121)
>>
>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>> at
>>>>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> ApplicationFilterChain.java:290)
>>
>>>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
>>>>
>> ApplicationFilterChain.java:206)
>>
>>>> at org.apache.catalina.core.StandardWrapperValve.invoke(
>>>>
>> StandardWrapperValve.java:233)
>>
>>>> at org.apache.catalina.core.StandardContextValve.invoke(
>>>>
>> StandardContextValve.java:175)
>>
>>>> at org.apache.catalina.core.StandardHostValve.invoke(
>>>>
>> StandardHostValve.java:128)
>>
>>>> at org.apache.catalina.valves.ErrorReportValve.invoke(
>>>>
>> ErrorReportValve.java:102)
>>
>>>> at org.apache.catalina.core.StandardEngineValve.invoke(
>>>>
>> StandardEngineValve.java:109)
>>
>>>> at org.apache.catalina.connector.CoyoteAdapter.service(
>>>>
>> CoyoteAdapter.java:263)
>>
>>>> at org.apache.coyote.http11.Http11Processor.process(
>>>>
>> Http11Processor.java:844)
>>
>>>> at
>>>>
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
>> Http11Protocol.java:584)
>>
>>>> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
>>>>
>> JIoEndpoint.java:447)
>>
>>>> at java.lang.Thread.run(Thread.java:619)
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Form.getMethod() throws Exception
Posted by Henrik Lundahl <he...@gmail.com>.
Hi
The parameters are left out of the request URL in the request that brings
you to the onSubmit method, but the response URL will contain the
PageParameters you set for the MyResponseClass page.
BR,
Henrik Lundahl
2008/2/18, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se>:
>
> Hello.
>
> It was just for debugging purposes.
>
> I wanted to see if I used GET or POST. I know from the code that POST is
> used as default (unless stated otherwise in the markup), but I just
> wanted it confirmed.
>
> With my very limited (next to nothing) knowledge about web coding in
> general I thought that when using POST any parameter passed on is not
> shown in the URL. This is however the case when I submit using
>
> ...
> onSubmit(){
> mySumbitButton.setResponsePage(MyResponseClass.class, new
> PageParameters("myKey=myValue"));
> }
> ...
>
>
> Martijn Dashorst skrev:
> > Don't call this method in a constructor. The component isn't added to
> > the page yet, and therefore doesn't know its markup causing it to fail
> > to find the method="foo" tag.
> >
> > Why do you want to call this method in a constructor?
> >
> > Martijn
> >
> > On 2/18/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se>
> wrote:
> >
> >> Hello all.
> >>
> >> When calling the getMethod from a subclass of a Form component an
> >> exception is thrown.
> >> When looking in the code I see the following comment just before the
> >> exception is thrown in Component.java:
> >> // This should never happen since Page always has associated markup
> >>
> >> If I out comment this call then my app runs like a charm :), so this
> >> looks like a bug to me. Is this a known problem?
> >>
> >> org.apache.wicket.WicketRuntimeException: Unable to find parent with
> associated markup
> >> at org.apache.wicket.Component.findParentWithAssociatedMarkup(
> Component.java:1218)
> >> at org.apache.wicket.MarkupFragmentFinder.find(
> MarkupFragmentFinder.java:50)
> >> at org.apache.wicket.Component.locateMarkupStream(Component.java
> :3614)
> >> at org.apache.wicket.Component.getMarkupAttributes(Component.java
> :1359)
> >> at org.apache.wicket.markup.html.form.Form.getMethod(Form.java
> :1378)
> >> at
> se.jorgenpersson.web.manager.TemplateManagement$ListTemplateForm.<init>(
> TemplateManagement.java:54)
> >> at se.jorgenpersson.web.manager.TemplateManagement.<init>(
> TemplateManagement.java:28)
> >> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> >> at java.lang.Class.newInstance0(Class.java:355)
> >> at java.lang.Class.newInstance(Class.java:308)
> >> at org.apache.wicket.session.DefaultPageFactory.newPage(
> DefaultPageFactory.java:58)
> >> at
> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage
> (BookmarkablePageRequestTarget.java:262)
> >> at
> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage
> (BookmarkablePageRequestTarget.java:283)
> >> at
> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents
> (BookmarkablePageRequestTarget.java:210)
> >> at
> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
> AbstractRequestCycleProcessor.java:90)
> >> at org.apache.wicket.RequestCycle.processEventsAndRespond(
> RequestCycle.java:1166)
> >> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
> >> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
> >> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
> >> at org.apache.wicket.protocol.http.WicketFilter.doGet(
> WicketFilter.java:354)
> >> at org.apache.wicket.protocol.http.WicketServlet.doGet(
> WicketServlet.java:121)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:290)
> >> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:206)
> >> at org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:233)
> >> at org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:175)
> >> at org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:128)
> >> at org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:102)
> >> at org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:109)
> >> at org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:263)
> >> at org.apache.coyote.http11.Http11Processor.process(
> Http11Processor.java:844)
> >> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
> Http11Protocol.java:584)
> >> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
> JIoEndpoint.java:447)
> >> at java.lang.Thread.run(Thread.java:619)
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >>
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Form.getMethod() throws Exception
Posted by "mailinglist@jorgenpersson.se" <ma...@jorgenpersson.se>.
Hello.
It was just for debugging purposes.
I wanted to see if I used GET or POST. I know from the code that POST is
used as default (unless stated otherwise in the markup), but I just
wanted it confirmed.
With my very limited (next to nothing) knowledge about web coding in
general I thought that when using POST any parameter passed on is not
shown in the URL. This is however the case when I submit using
...
onSubmit(){
mySumbitButton.setResponsePage(MyResponseClass.class, new
PageParameters("myKey=myValue"));
}
...
Martijn Dashorst skrev:
> Don't call this method in a constructor. The component isn't added to
> the page yet, and therefore doesn't know its markup causing it to fail
> to find the method="foo" tag.
>
> Why do you want to call this method in a constructor?
>
> Martijn
>
> On 2/18/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se> wrote:
>
>> Hello all.
>>
>> When calling the getMethod from a subclass of a Form component an
>> exception is thrown.
>> When looking in the code I see the following comment just before the
>> exception is thrown in Component.java:
>> // This should never happen since Page always has associated markup
>>
>> If I out comment this call then my app runs like a charm :), so this
>> looks like a bug to me. Is this a known problem?
>>
>> org.apache.wicket.WicketRuntimeException: Unable to find parent with associated markup
>> at org.apache.wicket.Component.findParentWithAssociatedMarkup(Component.java:1218)
>> at org.apache.wicket.MarkupFragmentFinder.find(MarkupFragmentFinder.java:50)
>> at org.apache.wicket.Component.locateMarkupStream(Component.java:3614)
>> at org.apache.wicket.Component.getMarkupAttributes(Component.java:1359)
>> at org.apache.wicket.markup.html.form.Form.getMethod(Form.java:1378)
>> at se.jorgenpersson.web.manager.TemplateManagement$ListTemplateForm.<init>(TemplateManagement.java:54)
>> at se.jorgenpersson.web.manager.TemplateManagement.<init>(TemplateManagement.java:28)
>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>> at java.lang.Class.newInstance0(Class.java:355)
>> at java.lang.Class.newInstance(Class.java:308)
>> at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
>> at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
>> at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
>> at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210)
>> at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:90)
>> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
>> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
>> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
>> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
>> at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:121)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
>> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
>> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>> at java.lang.Thread.run(Thread.java:619)
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Form.getMethod() throws Exception
Posted by Martijn Dashorst <ma...@gmail.com>.
Don't call this method in a constructor. The component isn't added to
the page yet, and therefore doesn't know its markup causing it to fail
to find the method="foo" tag.
Why do you want to call this method in a constructor?
Martijn
On 2/18/08, mailinglist@jorgenpersson.se <ma...@jorgenpersson.se> wrote:
> Hello all.
>
> When calling the getMethod from a subclass of a Form component an
> exception is thrown.
> When looking in the code I see the following comment just before the
> exception is thrown in Component.java:
> // This should never happen since Page always has associated markup
>
> If I out comment this call then my app runs like a charm :), so this
> looks like a bug to me. Is this a known problem?
>
> org.apache.wicket.WicketRuntimeException: Unable to find parent with associated markup
> at org.apache.wicket.Component.findParentWithAssociatedMarkup(Component.java:1218)
> at org.apache.wicket.MarkupFragmentFinder.find(MarkupFragmentFinder.java:50)
> at org.apache.wicket.Component.locateMarkupStream(Component.java:3614)
> at org.apache.wicket.Component.getMarkupAttributes(Component.java:1359)
> at org.apache.wicket.markup.html.form.Form.getMethod(Form.java:1378)
> at se.jorgenpersson.web.manager.TemplateManagement$ListTemplateForm.<init>(TemplateManagement.java:54)
> at se.jorgenpersson.web.manager.TemplateManagement.<init>(TemplateManagement.java:28)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> at java.lang.Class.newInstance0(Class.java:355)
> at java.lang.Class.newInstance(Class.java:308)
> at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
> at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
> at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
> at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:90)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
> at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:121)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> at java.lang.Thread.run(Thread.java:619)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org