How can i get context parameter value in jsp.?

后端 未结 5 1980
清酒与你
清酒与你 2020-12-16 00:37
  
        productSearchRPP
        8
    


        
相关标签:
5条回答
  • 2020-12-16 00:42
     application.getServletContext().getInitParameter("productSearchRPP");
    

    use this to get required result

    0 讨论(0)
  • 2020-12-16 00:44
    pageContext.getServletContext().getInitParameter("key");
    

    This is how you get context parameter value in JSP. In JSTL you can get it like this

    ${pageContext.servletContext}
    

    Or

    ${applicationScope.attributeName}
    
    0 讨论(0)
  • 2020-12-16 01:02

    Try this:

    application.getInitParameter("productSearchRPP")
    
    0 讨论(0)
  • 2020-12-16 01:04

    Even you can try this in your jsp.

    ServletContext context = pageContext.getServletContext();
    com = context.getInitParameter("com");
    

    and with jstl you can use.

    ${initParam['theStringIWant']}
    
    0 讨论(0)
  • 2020-12-16 01:05
    ${initParam['productSearchRPP']}
    

    Or, to get inside scriptlet

    <%= pageContext.getServletContext().getInitParameter("productSearchRPP") %>
    
    0 讨论(0)
提交回复
热议问题