开发者

HTML form submission in struts

Can I submit a simple html form with html tags and no struts tags. I'm using struts 1.0 and have a form like this:

<form action='/admin/fsubmit.html?action=search' method='post'>
  <input type='text' name='keyword'>
  <input type='submi开发者_JAVA技巧t' name='search' value='Search'>
</form>

I'm handling this submission with struts. but it seems like my action is never called. Do I need to use form with struts html tags?

If using struts html tags is the only option then how do I use two forms in single Action class?


The answer is yes,

The problem I see here is your action='/admin/fsubmit.html?action=search'. It's either your action is mapped to a .do extension or .html. If it's the latter, then your relative URL isn't mapped properly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜