简体   繁体   English

如何在整个项目中传递值并在程序中的任何地方使用它

[英]How do I pass a value throughout my project and use it anywhere in the program

How do I pass a value throughout my project and use it anywhere in the program. 如何在整个项目中传递值,并在程序中的任何地方使用它。 .. The value is selected before the login page... I want to access it anytime and in any jsp or servelet in a project ..该值是在登录页面之前选择的...我想随时随地在项目中的任何jsp或servelet中访问它

You can use HttpSession to do the same. 您可以使用HttpSession进行相同的操作。

Other than this you can initialize context parameters. 除此之外,您可以初始化上下文参数。

Follow this link for parameters approach. 请点击此链接获取参数方法。

init-param and context-param 初始化参数和上下文参数

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在整个程序中启用我的Socket并通过它传递值 - How can I make my Socket on throughout the program and pass value through it 是否可以为我在整个程序中使用的所有变量创建集中保存点? 如果是这样,怎么样? - Is it possible to create a centralized saving point of all the variables I use all throughout my program? If so, how? 如何在整个类中使用变量并将变量传递到新的android活动中? - How do I pass variables into a new android activity, with the ability to use them throughout the class? 我如何从 Discord OAUTH2 获取响应并将其转换为我自己的 UserDetails,我可以在整个代码中使用它 - How do I take the response from Discord OAUTH2 and translate it in to my own UserDetails that I can use throughout my code 如何在我的全局变量中存储一个值并在活动中的任何方法中使用它 - How can I store a value in my global variable and use it inside any method anywhere in activity 我如何在Java中为Fitnesse Fixture传递程序参数? - how do i pass program arguments in java for my Fitnesse Fixture? 根据开始时的值在整个程序中使用某些对象 - Use a certain objects throughout the program based on a value at start 如何将函数引用传递给我的方法并使用它们? - How do I pass function references into my method and use them? 如何在整个程序中调用我的游戏循环以及在tick()中放入什么 - How to call my gameloop throughout entire program and what to put in tick() 如何在整个程序中仅创建一个 Scanner 对象 - How to create only one Scanner object throughout my program
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM