English 中文(简体)
利用URL确定选定的纽芬兰语
原标题:Using URL to identify selected button

我的网页有多个纽州,每个纽特州都有名称和价值属性。 在点击纽顿之后,该网页将转至另一页,该页在行动上以选定的纽顿名称和价值表示的形式归属。

我想将后面一页中附在卢尔的选定国名或国名。 我如何能够做到这一点?

问题回答

如果你给纽特一个名字,那么它就只能作为请求参数提供。

E.g.

<input type="submit" name="add" value="Add" />
<input type="submit" name="edit" value="Edit" />
<input type="submit" name="delete" value="Delete" />

页: 1

if (request.getParameter("add") != null) {
    // Add button was pressed.
} else if (request.getParameter("edit") != null) {
    // Edit button was pressed.
} else if (request.getParameter("delete") != null) {
    // Delete button was pressed.
} else {
    // Handle exceptional/alternative case yourself.
}

or in JSP

<c:choose>
    <c:when test="${not empty param.add}">
        Add button was pressed.
    </c:when>
    <c:when test="${not empty param.edit}">
        Edit button was pressed.
    </c:when>
    <c:when test="${not empty param.delete}">
        Delete button was pressed.
    </c:when>
    <c:otherwise>
        Handle exceptional/alternative case yourself.
    </c:otherwise>
</c:choose>




相关问题
Parse players currently in lobby

I m attempting to write a bash script to parse out the following log file and give me a list of CURRENT players in the room (so ignoring players that left, but including players that may have rejoined)...

How to get instance from string in C#?

Is it possible to get the property of a class from string and then set a value? Example: string s = "label1.text"; string value = "new value"; label1.text = value; <--and some code that makes ...

XML DOM parsing br tag

I need to parse a xml string to obtain the xml DOM, the problem I m facing is with the self closing html tag like <br /> giving me the error of Tag mismatch expected </br>. I m aware this ...

Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

Locating specific string and capturing data following it

I built a site a long time ago and now I want to place the data into a database without copying and pasting the 400+ pages that it has grown to so that I can make the site database driven. My site ...

热门标签