标签: get-method

如何使用JSP从URL获取参数

在JSP中如何从URL获取参数?

例如,我有一个www.somesite.com/Transaction_List.jsp?accountID=5
我想要获得的URL 5.

是否有一个request.getAttribute("accountID")就像会话或类似的东西?

java url jsp get-method

185
推荐指数
5
解决办法
51万
查看次数

如何使用GetMethod进行静态扩展方法

我有一个扩展方法:

public static class StringEx
{
    public static bool Like(this string a, string b)
    {
        return a.ToLower().Contains(b.ToLower());
    }
}
Run Code Online (Sandbox Code Playgroud)

如何使用我的参数通过GetMethod正确反映它?我试过这个没有成功(静态方法有例外):

var like = typeof(StringEx).GetMethod("Like", new[] {typeof(string), typeof(string)});
comparer = Expression.Call(prop, like, value);
Run Code Online (Sandbox Code Playgroud)

.net reflection extension-methods static get-method

8
推荐指数
2
解决办法
4981
查看次数

Html.BeginForm使用FormMethod.GET丢失routeValues

我注意到什么Html.BeginForm()方法编码提供routeValues行动 FORM标签的属性.这适用于POST方法.但是如果方法是GET,则操作URL中的所有参数都被浏览器剥离(在IE8和Firefox 3.0.7上测试).

例如,这个代码在视图中

<%
    using (Html.BeginForm("TestAction", "TestController", new { test = 123 }, 
        FormMethod.Get)) 
    {
        Response.Write("<input type='submit'>");
    };
%>
Run Code Online (Sandbox Code Playgroud)

给出了这样的HTML

<form action="/TestController/TestAction?test=123" method="get">
    <input type='submit'>
</form>
Run Code Online (Sandbox Code Playgroud)

但提交表单后的URL变为/ TestController/TestAction而不是/ TestController/TestAction?test = 123(参数丢失).

现在我使用Html.Hidden()调用而不是routeValues参数,但我感兴趣的还有另一种解决方法吗?它应该被视为MVC中的错误,有时会被修复吗?

parameters asp.net-mvc get-method

7
推荐指数
1
解决办法
5372
查看次数

是否有一个JQuery或JS等效于PHP的$ name = $ _GET ['name']

我试图找出一种方法来从一个表单用JavaScript读取GET方法信息.我们的IT部门使我们的服务器处于锁定状态,作为Web团队,我们只能使用javascript来完成我们的任务.如果可以的话,我会使用PHP,但我不能.

我需要做的是读取js中通过GET方法发送的数据(如果可能),这样我就可以将数据分配到变量中,并在用户对表单执行操作后在各个页面上使用它.

即.如果数据是在网址中发送的http://somesite.com?add_to_cart=true&items=10

任何帮助,将不胜感激!

javascript php forms jquery get-method

1
推荐指数
2
解决办法
2802
查看次数

如何将int值附加到android中的改装的GET url

我有以下网址 http://54.169.227.89:90/DataAccessService.svc/GetProducts/2 我想使用我改装获取方法如何追加2这是我在登录时从sharepreference获得的公司ID

这是ma接口代码

public interface ProductsGet {


    String Company_id = OrderApplication.CompanyID_New;


    @GET("/DataAccessService.svc/GetProducts/")
    public void getProducts( Callback<List<ProductsNew>> response);
}
Run Code Online (Sandbox Code Playgroud)

android interface get-method retrofit

-1
推荐指数
1
解决办法
3695
查看次数