开发者

Struts | assign a value to a logic tag using Javascript

How do I assign a value to a struts logic tag using Javascript, I have tried many ways but never worked out.

here's the sample code:

<logic:equal name=开发者_StackOverflow社区"myName" property="myId" value="idValue" >

Thanks.


You can't assign a value to a logic tag using Javascript. The logic:equal tag runs on the server, while JavaScript runs on the client (i.e. the browser).

The server tags are interpreted at the server and the result they produce is written to the response stream. Everything else in the JSP file that is not a server tag or scriptlet is written as is in the response. That includes HTML and JavaScript. Your JavaScript is not executed at this point, so you can't set values for the server tags using JavaScript.

What are you trying to achieve? There may be another way of doing it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜