I have a webapp that is bound to root "/" context, and I am mounting a
bookmarkable page to "/script/execute" via:

        mountBookmarkablePage( "/script/execute", ScriptExecutor.class );

That page displays a textarea and a submit button within the form.  The
code is as follows:


public class ScriptExecutor extends WebPage
{
    private static final Log log = LogFactory.getLog(ScriptExecutor.class);

    String script;

    public ScriptExecutor()
    {
        Form form = new Form( this, "form" ) {

            final TextArea textarea = new TextArea( this, "textarea",
new PropertyModel( ScriptExecutor.this, "script" ) );
           
            protected void onSubmit()
            {
                super.onSubmit();

                System.out.println("TextArea: " + getScript() );
            }
        };              
    }


    public String getScript()
    {
        return script;
    }

    public void setScript(String script)
    {
        this.script = script;
    }
}

When I first load the page via the bookmarkable url and hit submit, I
get a 404 because wicket is submitting to:

   
http://localhost:8080/script/?wicket:interface=:5:form::IFormSubmitListener

when it should be submitting to:

    http://localhost:8080/?wicket:interface=:5:form::IFormSubmitListener

This all seems to be due to the fact wicket isn't prepending a "/" to
the form's action URL, causing the browser to use the current directory
from the url, "/script/":

<body>
        <form id="form0" 
action="?wicket:interface=:5:form::IFormSubmitListener" method="post" 
wicket:id="form">
                <div style="display:none"><input type="hidden" 
name="form0:hf:fs" id="form0:hf:fs"/>
                <input type="hidden" name="wicketState" id="form0:hf:ws"/></div>
                <textarea style="width: 500px; height: 500px" 
wicket:id="textarea" name="textarea"></textarea>
                <br/>

                <input type="submit" value="Execute"/>
        </form>
</body>


Is this a user error on my part or an issue with how wicket is
generating the url?

Aaron

-------------------------------------------------------------------------
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

Reply via email to