EL表达式传参数的问题!!!!!!!

EL表达式传参数的问题!!!!!!!,第1张

你是说用EL表达式传递方法参数的问题吧.

这个用EL表达式是实现不了的.

但是有另外一个方式可以实现,用自定义标签

自己写个标签,然后在页面引用。不过麻烦程度很高,

而且还要会写自定义标签和配置标签以及使用。

所以你自己权衡利弊吧。

希望我可以帮助到你

只要在action中添加同名变量,并添加get、set方法。

如: <input name="userId" value="${ userId}"/>

public class Test{

private Long userId;

public String execute(){

System.out.println(userId)

return "success"

}

public Long getUserId(){

return userId

}

public void setUserId(Long userId){

this.userId = userId

}

}

你应该加上引号, onclick="update_shop_password( '${list_xinxi.store_password}' )"

因为如果你不加引号,那么等于你的函数参数传入是一个变量,但是这个变量又没有定义


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/11799232.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-18
下一篇2023-05-18

发表评论

登录后才能评论

评论列表(0条)

    保存