开发者

How do I check that a session object contains a particular key/value entry

I want to check if a certain key/value pair has be开发者_如何学Goen set.

How do I check if a an entry with key named "keyName" exists. Sample code or a pointer to an example would be appreciated.


If you want to differ between "not set" and null, step through session.getAttributeNames() and search your key name.


Heres a simple introductory tutorial to JSP Sessions

In essence you should just need to check that session.getAttribute("keyName") is not null.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜