如何在jsp中获取上下文参数值? [英] How can i get context parameter value in jsp.?

查看:495
本文介绍了如何在jsp中获取上下文参数值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  <context-param>
        <param-name>productSearchRPP</param-name>
        <param-value>8</param-value>
    </context-param>

我想在products.jsp页面中获得productSearchRPP的价值

I want to get value of productSearchRPP in products.jsp page

推荐答案

即使你可以在你的jsp中试试这个。

Even you can try this in your jsp.

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

您可以使用jstl。

${initParam['theStringIWant']}

这篇关于如何在jsp中获取上下文参数值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆