jsp-tags


Unable to access session on JSP


I have a JSP with netbiscuits code in it, I am now removing that netbiscuits code but after removing I am unable to get session from my previous page due to which I am unable to move ahead. I am using struts 1. Please suggest a solution to my problem, I would be grateful. Thanks in advance.
I am not sure about your problem.
Can you explain it little more?
Usually for accessing session in jsp pages we use the code with in scriptlets like
String x=(String)session.getAttribute("uname");
Type casting is required.
or use
String x=""+session.getAttribute("uname");
If you want to print it somewhere in the jsp page do,
<%= session.getAttribute("uname")%>
It will print the session value in jsp page.
otherwise use like
<% String x=""+session.getAttribute("uname"); %>
<%=x %>
For accessing in java pages
Map session = ActionContext.getContext().getSession();
String uname=""+session.get("uname");

Related Links

Servlet exception stream closed jsp
creating and exporting a csv from Display tag table
bean write to number type id
restrict image file size in alloy UI
The function getContextPath must be used with a prefix when a default namespace is not specified
how can i retrive parameters from EncodeURL using jsp?
onclick tag giving error in h:commandLink
Displaytag - How to pass hidden value in url?
Embedding Tag Files in a JAR
Errors when the compiler is trying to build a custom JSP tag based on an Java Bean
Creating nested custom tag using jsp2 tag files
Unable to access session on JSP
Dealing with <html:options>
No tag “tableFacade” defined in tag library imported with prefix “jmesa”
how to refer values of one jsp file to other jsp
incorrect username and passwords

Categories

HOME
vim
jdo
clips
pypi
single-sign-on
appx
raspberry-pi
framework7
gis
cmd
rubygems
binary-tree
fingerprint
yum
gorm
ssl-client-authentication
adobe-analytics
user-input
correlation
spring-tool-suite
phaser
decimal
clojurescript
ghc
graphlab
django-admin
csrf-protection
buildbot
centos6.5
traffic
unboundid
data-manipulation
scorm2004
code-contracts
grails-3.1
asset-pipeline
mapbox-gl
sequential
web-mining
hot-module-replacement
email-templates
outlook-api
network-flow
hendrix
statsd
drupal-6
typed-lambda-calculus
python-cryptography
sqldf
specrun
time-and-attendance
setuptools
color-picker
log4c
simplewebrtc
essence
bgp
spim
browser-bugs
graph-drawing
nstableviewcell
gadt
flask-cors
mesa
expected-exception
datagridviewcolumn
floating-point-precision
ivyde
google-cloud-save
quartz-graphics
ruby-datamapper
dotnetnuke-5
batterylevel
xamlparseexception
smtp-auth
drools-planner
browser-detection
libstdc++
nsnetservice
errai
online-compilation
bubble-chart
removeclass
assembly-loading
cufon
infobox
iphone-web-app
mysql-error-1005
h.323
gallio
dentrix
gin
modelstate
dbal
ncqrs
sector
document-conversion

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App