I am trying to mimic the default login form in Tomcat which uses:
<form method="POST" action="j_security_check">
<table>
<tr><td>Name:</td><td><input type="text" name="j_username" /></td></tr>
<tr><td>Password:</td><td><input type="password" name="j_password" /></td></tr>
<tr><td colspan="2"><input type="submit" value="Login" /></td></tr>
</table>
</form>
I tried using the following:
login.xml:
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item type="settings" position="label-left" labelWidth="120" inputWidth="150" noteWidth="200"/>
<item type="fieldset" name="data" inputWidth="auto" label="Login">
<item type="input" value="" label="Username" name="j_username" validate="NotEmpty" info="true">
<note>Enter username</note>
</item>
<item type="password" value="" label="Password" name="j_password" validate="NotEmpty" info="1">
<note width="150">Enter password</note>
</item>
<item type="button" value="Login" name="login"/>
</item>
</items>
Page code:
<script>
myForm = new dhtmlXForm("myForm");
myForm.loadStruct("login.xml?e=" + new Date().getTime());
myform.attachEvent("onButtonClick", function(name, command) {
this.send("j_security_check", "post");
});
</script>
<div id="myForm" style="height:500px;"></div>
What happens is it seems to login ok but does not re-direct to the secured page.
