HTML表单操作标签。调用父亲相对URL [英] HTML Form action tag. Calling a parent relative URL

查看:179
本文介绍了HTML表单操作标签。调用父亲相对URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图设置一个HTML表单(实际上在Spring-MVC应用程序的上下文中是 .jsp )。



假设我在网址:

  example.com/第一个/第二个

并且我想调用一个动作

  example.com/post 

应该怎样行动看起来像?



我预计这工作:

  < form:form method =postaction =../ post> 

但这不起作用。

解决方案

父目录中 post 的相对路径: ... action =../ post



根目录中 post 的相对路径: ... action =/ post


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.

解决方案

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

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

这篇关于HTML表单操作标签。调用父亲相对URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆