javascript - Load struts tag in js file or pass values from action to js file -


i searching way use struts tag in .js files can directly pass value action class .js file when js loaded page (of course, can done if script inside <script> tag inside jsp file. want directly pass js file.). found solution in this link asks add <%@ taglib uri="/web-inf/struts-bean.tld" prefix="bean"%> @ top of js file , add following in web.xml

<servlet>     <servlet-name >jspservlet</servlet-name >     < servlet-class >org.apache.jasper.servlet.jspservlet</servlet-class >   <servlet-mapping>      <servlet-name>jspservlet</servlet-name>      <url-pattern>/scripts/dynamic/*</url-pattern> </servlet-mapping> 

(sorry add xml code html snippet. didn't find other way it). didn't work me. can 1 me way it..?? in advance

actually u need values action class.right? may u can use hidden type use id of hidden type value. may try.like...

<input type="hidden" value="<s:property value='your variable'/>" id="my_id"/> 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -