HTML Form action tag. Calling a parent relative UR

2020-07-10 08:38发布

I am trying to setup a HTML form (Actually .jsp in the context of a Spring-MVC Application).

Assuming I am at the URL:

example.com/first/second

and I want to call an action to

example.com/post

What should the Action look like?

I expected this to work:

<form:form method="post" action="../post">

But this doesn't work.

1条回答
Root(大扎)
2楼-- · 2020-07-10 09:19

Relative path to post in the parent directory: ... action="../post"

Relative path to post in the root directory: ... action="/post"

查看更多
登录 后发表回答