variable from .jsp to the html page

后端 未结 5 2069
猫巷女王i
猫巷女王i 2020-12-11 15:01

I have a .jsp page that passes the variable from the servlet. Lets assume that I have a .jsp page like

...

${Variable         


        
5条回答
  •  离开以前
    2020-12-11 15:32

    before accessing variable inside html you need to initialize the variable and then do whatever the calculations and other modifications inside another JSP code block. Now you can access the variable inside the html. This is my first answer for the Stackoverflow.com please experts notify the mistakes i've done.

    
    <% java.lang.Integer var=0; %>
    <%
      int a;
      int b;
      var=a+b;
    %>
    <% out.print(var);%>
    
    

提交回复
热议问题