Servlet session problem
hi all,
I am new to servlet. i have creted a server program and many user can login using thier username ,role and password. if more than one user can login simultaneously i could nt able to mainatin the session, it always showing the last login datas to all users(who'slogin earlier). how do i solve this and please any one explain me with some example?
regards
sm
if more than one user can login simultaneously i could nt able to mainatin the session, it always showing the last login datas to all users(who'slogin earlier). Do you mean to say different users logging into the system using same browser window?
how do i solve thisThis is more about what do you want to do? One solution might be :- if the user authentication succeeds, add a logic that will invalidate the previous session and create a new session for this new user.
Similar Messages
-
IllegalStateException: Internal Servlet Session Process Error Found!
I keep getting the annoying error as listed, and the server also keeps reporting
that I can only connect from 0 unique ip addresses. Has anybody else seen these
type of frustrations on 8.1 sp2, or can explain them.
With as much detail omitted for simplicity;
Frustration 1.
I have a 8sp2 server running all ok, occasionally after a redeploy of an ear file
I attempt to load a jsp file, and the error below is thrown.
The JSP has a bean which is session based, and as from following the stack trace
it is around some weblogic code which tests if my license allows access to the
http session (on a developer license). I then have to start another server instance
and do a deployment of a v.simple war, and access this, then deploy the same war
to the broken server and access that, then the initial jsp works fine. no code
changes just environment stops, starts and redeploys!
Frustration 2
Server runs ok, tray and connect from two machines (I have an ldap server that
wants to 'broadcast' messages to my server), error of too many connections.
The ip connection issues can in most cases be removed with a server restart.
EXCEPTION TRACE
java.lang.IllegalStateException: Internal Servlet Session Process Error Found!
With the following stack trace:
java.lang.IllegalStateException: Internal Servlet Session Process Error Found!
at weblogic.servlet.internal.session.SessionData.checkProcess(SessionData.java:1148)
at weblogic.servlet.internal.session.SessionData.setAttribute(SessionData.java:501)
at jsp_servlet._security.__changeprofile._jspService(__changeprofile.java:135)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:446)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
I have the same problem. Could any one help us?
"David" <[email protected]> wrote:
>
>I keep getting the annoying error as listed, and the server also keeps
>reporting
>that I can only connect from 0 unique ip addresses. Has anybody else
>seen these
>type of frustrations on 8.1 sp2, or can explain them.
>
>With as much detail omitted for simplicity;
>
>Frustration 1.
>I have a 8sp2 server running all ok, occasionally after a redeploy of
>an ear file
>I attempt to load a jsp file, and the error below is thrown.
>
>The JSP has a bean which is session based, and as from following the
>stack trace
>it is around some weblogic code which tests if my license allows access
>to the
>http session (on a developer license). I then have to start another
>server instance
>and do a deployment of a v.simple war, and access this, then deploy the
>same war
>to the broken server and access that, then the initial jsp works fine.
> no code
>changes just environment stops, starts and redeploys!
>
>Frustration 2
>Server runs ok, tray and connect from two machines (I have an ldap server
>that
>wants to 'broadcast' messages to my server), error of too many connections.
>The ip connection issues can in most cases be removed with a server restart.
>
>
>EXCEPTION TRACE
>
>java.lang.IllegalStateException: Internal Servlet Session Process Error
>Found!
>
>With the following stack trace:
>
>java.lang.IllegalStateException: Internal Servlet Session Process Error
>Found!
> at weblogic.servlet.internal.session.SessionData.checkProcess(SessionData.java:1148)
> at weblogic.servlet.internal.session.SessionData.setAttribute(SessionData.java:501)
> at jsp_servlet._security.__changeprofile._jspService(__changeprofile.java:135)
> at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
> at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:446)
> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
> at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
> at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
> at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
> at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
> at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
>
-
Servlet Compilation Problem !
Hi,
I am just starting to learn servlets and I got problem in compiling them. I got compilation error in
import javax.servlet.*;statement. Seems that the compiler cannot find the servlet package. I got J2EE 1.4 beta installed on my machine but there is no servlet.jar package. I am using J2SDK 1.4.1_02, J2EE 1.4 beta and Tomcat 4.1.24.
Can anyone help me with my servlet compilation problem?
Thanks in advance!
Joshservlet.jar is here :
<tomcatdir>\common\lib
add it to your compiler classpath -
Java Session problem while sending mail(using javamail) using Pl/SQL
Hello ...
i am using Java stored procedure to send mail. but i'm getting java session problem. means only once i can execute that procedure
pls any help.props.put("smtp.gmail.com",host);I doubt javamail recognizes the 'smtp.gmail.com' property. I think it expects 'mail.host'. Of course since it cannot find a specified howt it assumes by default localhost
Please format your code when you post the next time, there is a nice 'code' button above the post area.
Mike -
Servlet chaining problem..
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Deblink extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
String contentType = req.getContentType(); // get the incoming type
if (contentType == null) return; // nothing incoming, nothing to do
res.setContentType(contentType); // set outgoing type to be incoming type
PrintWriter out = res.getWriter();
BufferedReader in = req.getReader();
String line = null;
while ((line = in.readLine()) != null) {
line = replace(line, "<BLINK>", "");
line = replace(line, "</BLINK>", "");
out.println(line);
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
doGet(req, res);
private String replace(String line, String oldString, String newString) {
int index = 0;
while ((index = line.indexOf(oldString, index)) >= 0) {
// Replace the old string with the new string (inefficiently)
line = line.substring(0, index) +
newString +
line.substring(index + oldString.length());
index += newString.length();
return line;
What is pre request fo above code to work.
I had tried this many time but it is not working, what will be calling servlet look likeAnd can you explain why your title is "Servlet chaining problem"?
-
Session problem in jsp application
I face a session problem. I setting everything in a session and when pass back to a main page, the value is not display in the screen. But after refresh the value will display in the screen and this kind of problem only come out very few time and i dun knw how to solve this...
Anyone here can give me some idea and suggestion or the way to solve this kind of problem!!!define "2 different clients"
1) You have 2 different PCs and it's using the same session ID for both? I doubt this. I think the server is advanced enough not to use give a session ID that's already been created.
2) You have 1 PC and are using IE or Netscape and using File > New Window to open a new window and connect again. This you can't fix without using only URL rewriting to manage session, because the different windows will share the same session cookies. -
Weblogic 8.1 SP2 + Struts + Internal Servlet Session Process Error Found!
Hi,
I have developed a struts 1.1 based webapplication which runs fine on
weblogic 7 (for one year in production), tomcat 4.1,5 and others but
refuses to function in weblogic 8.1 sp2!
This is the stacktrace I get when I try to call an action via the browser:
java.lang.IllegalStateException: Internal Servlet Session Process Error
Found!
at
weblogic.servlet.internal.session.SessionData.checkProcess(SessionData.java:1148)
at
weblogic.servlet.internal.session.SessionData.setAttribute(SessionData.java:501)
at
org.apache.struts.action.RequestProcessor.processLocale(RequestProcessor.java:638)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:230)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:502)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Just out of curiosity I deployed the struts-examples webapplication from
the apache jakarta struts distribution and it also fails to run with the
same error!
Can anybody help me out with this one? Does anybody experience the same
thing?
regards,
oliver
p.s. I will also post this message on the struts user list.
Hi,
I have developed a struts 1.1 based webapplication which runs fine on
weblogic 7 (for one year in production), tomcat 4.1,5 and others but
refuses to function in weblogic 8.1 sp2!
This is the stacktrace I get when I try to call an action via the browser:
java.lang.IllegalStateException: Internal Servlet Session Process Error
Found!
at
weblogic.servlet.internal.session.SessionData.checkProcess(SessionData.java:1148)
at
weblogic.servlet.internal.session.SessionData.setAttribute(SessionData.java:501)
at
org.apache.struts.action.RequestProcessor.processLocale(RequestProcessor.java:638)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:230)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:502)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Just out of curiosity I deployed the struts-examples webapplication from
the apache jakarta struts distribution and it also fails to run with the
same error!
Can anybody help me out with this one? Does anybody experience the same
thing?
regards,
oliver
p.s. I will also post this message on the struts user list.
-
I need to get the lastAccessTime of the servlet which I have deployed on Weblogic
7.0.
I have found that by using ServletSessionRuntimeMBean interface which has a method
called getTimeLastAccessed, I can get the same.
I am not able to get the same. Can any one sujject the way I have to go for this.
Hello Linus,
Actually, you would want to retrieve the necessary objects from your servlet context
and then pass them along to your session EJBs. It's not necessary to pass the
entire ServletContext object to your session bean. You should wrap the values
in DTOs (Data Transfer Objects / Value Objects) and pass them along to your session
beans. Also, it's not good to couple your EJBs with Servlets, as they may be eventually
accessed from standalone clients in the future. For more information on this design
pattern, please see the following link:
http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html
Best regards,
Ryan LeCompte
[email protected]
http://www.louisiana.edu/~rml7669
"Linus Nikander" <[email protected]> wrote:
Is it possible to accesss objects stored in a Servlet session context
from
an EJB ? If so, how ?
//Linus Nikander - [email protected] -
Servlet Sessions+dont have a clue
im trying to get a servlet session goin for a college project,i know its hard to help someone on this but please try this is driving me mad,,,
im useless at java so i have just being piecing together other peoples code and trying to get it working,
Iam trying to accept a username and password for the Oracle database and then put the resulting database connection into a session variable...
here is my useless code,,,please help....the only error iam getting is to do with the PrintWriter,,,
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
// You need to import the java.sql package to use JDBC
import java.sql.*;
public class LoginServlet1 extends HttpServlet
private Connection con=null;
public LoginServlet1(Connection con){
this.con=con;
public Connection getConnection(){
return con;
public void doGet(HttpServletRequest request,HttpServletResponse response)
PrintWriter writer = response.getWriter();
HttpSession session = request.getSession(true);
String username = null;
String password = null;
String strHTML = "";
boolean success = false;
if (((username==null) || (username.compareTo("")==0)))
strHTML = strHTML + "<title> Lab #11 Login Error </title>";
strHTML = strHTML + "</head>";
strHTML = strHTML + "<body bgcolor=white>";
strHTML = strHTML + "Massive Error --- you need to provide a username ...please try again ...<BR><BR>";
strHTML = strHTML + "Back to the login page ..<A HREF=\"../login.html\"> click here </A>";
strHTML = strHTML + "</body>";
strHTML = strHTML + "</html>";
success = false;
else if (((password==null) || (password.compareTo("")==0)))
strHTML = strHTML + "<title> Lab #11 Login Error </title>";
strHTML = strHTML + "</head>";
strHTML = strHTML + "<body bgcolor=white>";
strHTML = strHTML + "Massive Error --- you need to provide a password ... please try again ...<BR><BR>";
strHTML = strHTML + "Back to the login page ...<A HREF=\"../login.html\"> click here </A>";
strHTML = strHTML + "</body>";
strHTML = strHTML + "</html>";
success = false;
else
try
// Load Oracle driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
LoginServlet1 holder=(LoginServlet1) session.getValue("servletapp.connection");
if(holder==null){
try{
holder= new LoginServlet1(DriverManager.getConnection("jdbc:oracle:thin:@macha.wit.ie:1521:MACH"));
session.putValue("servletapp.connection",holder);
catch(SQLException e){
getServletContext().log(e, "No");
success= true;
catch (SQLException sqlex)
strHTML = strHTML + "connection failed ....<BR>";
if (sqlex.getErrorCode()==1017)
strHTML = strHTML + "OUPS !!! wrong username or password lads ...please try again ...<BR><BR>";
else
strHTML = strHTML + "SQL Error happened ....<BR>";
strHTML = strHTML + "Error Number = " sqlex.getErrorCode() "<BR>";
strHTML = strHTML + "Error Message = " + sqlex.getMessage() + "<BR>";
strHTML = strHTML + "ah common cheer up, it's not the end of the world...<BR>";
strHTML = strHTML + "Back to the login page<A HREF=\"../login.html\"> click here </A>";
success = false;
if (success)
try
getServletConfig().getServletContext().getRequestDispatcher("/WEB-INF/jsp/query.jsp").forward(request,response);
catch (Exception ex) {
ex.printStackTrace ();back again,,
the code above is causing the following error when i try to run it,,
Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
the error goes on to give a very long list of exceptions and root causes,there is nothing wrong with Tomcat because i can run the other version of this program that doesnt have any sessions is it,,,
thanks -
How to share objects between two ADF Faces servlet sessions
I gather the application scope is one way to go for sharing data between sessions in an ADF application. Are there other more generic methods of sharing data between servlet sessions?
For example, let's say we have a JDev 101.3 ADFBC/JSF app. (or JDev 11g for that matter). In this app we also register a servlet in web.xml. So two people log into this application and access this defined servlet, creating two instances of that servlet...I guess. Is there a way for those two instances/sessions to talk to each other? Pass data back and forth? Should I read about JMS? Or does application scope sound better? I guess a direct communication would be more tidy, than putting data on an application bulletin board, lilke application scope.
Any thoughts?Hi,
Only one instance of each servlet defined in web.xml gets created, not one per user. You're right about the sessions though, one per user is created. You're right on the other parts as well I think you could use application scope to do something like that, or the data base for that matter, depending on the use case.
Regards,
~ Simon -
Servlet Session Monitoring via MBeans turns up no MBeans
Hi,
I discovered more about why I'm not seeing any Servlet Session Runtime
MBeans when I enable session monitoring. It looks like each time my
managed server creates a new session, two errors get written to my
WebLogic log:
"####<Sep 22, 2002 6:46:43 PM EDT> <Warning> <Dispatcher>
<chile.iso-ne.com> <adminserver> <ExecuteThread: '7' for queue:
'__weblogic_admin_rmi_queue'> <> <> <000000> <RuntimeException thrown
by rmi server: 'weblogic.rmi.internal.BasicServerRef@10b - jvmid:
'7074298665992588400S:10.145.220.82:[7001,7001,7002,7002,7001,7002,-1]:smsdomain:adminserver',
oid: '267', implementation:
'weblogic.management.internal.AdminMBeanHomeImpl@3c7b65''>
weblogic.management.NoAccessRuntimeException: User guest does not have
access permission on weblogic.admin.mbean.MBeanHome
at weblogic.management.internal.Helper.checkAdminPermission(Helper.java:1637)
and
"####<Sep 22, 2002 6:46:43 PM EDT> <Error> <HTTP Session>
<chile.iso-ne.com> <webuiserver> <ExecuteThread: '0' for queue:
'default'> <> <> <100032> <Error creating servlet session runtime>
weblogic.management.NoAccessRuntimeException: User guest does not have
access permission on weblogic.admin.mbean.MBeanHome
at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:85)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:136)
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
at $Proxy7.getMBeanServer(Unknown Source)
at weblogic.management.internal.MBeanHomeImpl.isAdminHome(MBeanHomeImpl.java:93)
at weblogic.management.internal.MBeanHomeImpl.getMBean(MBeanHomeImpl.java:118)
at weblogic.management.internal.MBeanHomeImpl.getRuntimeMBean(MBeanHomeImpl.java:590)
at weblogic.management.internal.MBeanHomeImpl.getRuntimeMBean(MBeanHomeImpl.java:568)
at weblogic.servlet.internal.session.SessionData$1.run(SessionData.java:185)
at weblogic.management.internal.Helper.doLocally(Helper.java:1656)
at weblogic.servlet.internal.session.SessionData.getRuntimeMBean(SessionData.java:179)
at weblogic.servlet.internal.session.SessionData.<init>(SessionData.java:166)
Looks like the managed server is making a request of the admin server
and propagating the "guest" principal instead of "system".
These principal propagation errors from managed-to-admin seem to
happen all over the place with different MBeans, and get patched one
place at a time in various BEA service packs. For instance, there's
another issue with accessing the XML Entity Cache from a managed
server, and I'm sure I've read about others. Isn't there a way to
make sure these errors no longer occur with any MBean requests from
the managed server?
JimAdd
acl.access.weblogic.admin.mbean.MBeanHome=guest
in the filerealm.properties file.
Jim Doyle wrote:
Hi,
I discovered more about why I'm not seeing any Servlet Session Runtime
MBeans when I enable session monitoring. It looks like each time my
managed server creates a new session, two errors get written to my
WebLogic log:
"####<Sep 22, 2002 6:46:43 PM EDT> <Warning> <Dispatcher>
<chile.iso-ne.com> <adminserver> <ExecuteThread: '7' for queue:
'__weblogic_admin_rmi_queue'> <> <> <000000> <RuntimeException thrown
by rmi server: 'weblogic.rmi.internal.BasicServerRef@10b - jvmid:
'7074298665992588400S:10.145.220.82:[7001,7001,7002,7002,7001,7002,-1]:smsdomain:adminserver',
oid: '267', implementation:
'weblogic.management.internal.AdminMBeanHomeImpl@3c7b65''>
weblogic.management.NoAccessRuntimeException: User guest does not have
access permission on weblogic.admin.mbean.MBeanHome
at weblogic.management.internal.Helper.checkAdminPermission(Helper.java:1637)
and
"####<Sep 22, 2002 6:46:43 PM EDT> <Error> <HTTP Session>
<chile.iso-ne.com> <webuiserver> <ExecuteThread: '0' for queue:
'default'> <> <> <100032> <Error creating servlet session runtime>
weblogic.management.NoAccessRuntimeException: User guest does not have
access permission on weblogic.admin.mbean.MBeanHome
at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:85)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:136)
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
at $Proxy7.getMBeanServer(Unknown Source)
at weblogic.management.internal.MBeanHomeImpl.isAdminHome(MBeanHomeImpl.java:93)
at weblogic.management.internal.MBeanHomeImpl.getMBean(MBeanHomeImpl.java:118)
at weblogic.management.internal.MBeanHomeImpl.getRuntimeMBean(MBeanHomeImpl.java:590)
at weblogic.management.internal.MBeanHomeImpl.getRuntimeMBean(MBeanHomeImpl.java:568)
at weblogic.servlet.internal.session.SessionData$1.run(SessionData.java:185)
at weblogic.management.internal.Helper.doLocally(Helper.java:1656)
at weblogic.servlet.internal.session.SessionData.getRuntimeMBean(SessionData.java:179)
at weblogic.servlet.internal.session.SessionData.<init>(SessionData.java:166)
Looks like the managed server is making a request of the admin server
and propagating the "guest" principal instead of "system".
These principal propagation errors from managed-to-admin seem to
happen all over the place with different MBeans, and get patched one
place at a time in various BEA service packs. For instance, there's
another issue with accessing the XML Entity Cache from a managed
server, and I'm sure I've read about others. Isn't there a way to
make sure these errors no longer occur with any MBean requests from
the managed server?
Jim--
Rajesh Mirchandani
Developer Relations Engineer
BEA Support -
Get the Web users Clipboard text in Servlet session
We have a small web application � uses JSPs , Servlets and runs on Tomcat Server.
We are trying to get the end web user�s ( browsers ) Clipboards copied text in our Servlets session.
We know there is some AWT API to get the Clipboards copied data.
java.awt.datatransfer.Clipboard clipboard = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();
// Get data from clipboard
java.awt.datatransfer.Transferable clipData = clipboard.getContents(clipboard);
But if we use this piece of code in our servlet session, we always get the Clipboard text, which is copied on the Server. Not at the users / browsers.
So, we wonder are there any ways or similar to get the Users clipboard text in that users session.
Any help would be great.Its the same old story.
Java code is only running on the server.
At the client end all you can work with is HTML and javascript.
With Internet explorer you can access clipboard data:
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/clipboarddata.asp?frame=true
Grab it with javascript, put it into a hidden field, and submit the page.
That will pass it as a request parameter to your jsp/servlet, and you can get at it that way. -
Hi i had one doubt in session (servlet)
I had deploy two application in tomcat with two different war files e.g., A.war and B.war.,
At one situation i am forward my application from A to B at the time i had store some values in session in A and Pass to B
My question is
Whether it is possible to pass the session from A application to B application how it is can u give solutions
Regards
Marimuthuhi,
you have to make true for crossContext attribute
for ex
in your installtomcatdir/conf/server.xml
<Context path="/air" docBase="d:/air" debug="0"
reloadable="true" crossContext="true"> -
Session problem in servlet??
hello,
i have made a simple shopping cart which goes through the
following stage:
1st stage:
// Additions to the shopping cart
HttpSession clientSession = request.getSession( true );
ShoppingCart vBasket = (ShoppingCart)clientSession.getValue("thecart");
if ( vBasket == null ){
System.out.println("NO CART");
vBasket = new ShoppingCart();
clientSession.putValue("thecart", vBasket);
System.out.println("MADE THE CART");
vBasket.add(the_item);
// at this stage, the items are being added to a hashtable
2nd stage:
HttpSession clientSession = request.getSession(false);
System.out.println("GOT THE SESSION");
ShoppingCart vBasket = (ShoppingCart)clientSession.getValue("thecart");
if ( vBasket == null ){
System.out.println("CART HASN'T BEEN MADE!!");
throw new Exception();
// At this stage, the object of the ShoppingCart class still has null value even if in the existing session the ShoppingCart has been made at stage 1. Any idea why this is happening??
thanks
Richardi believe that if u declare the writer before u get the session you may have problem like yours (happened to me). so make sure to get the session before instantiate your (response)writer.
-
Session problem in a new window created by window.open()
hello,
I have a drugsearch.jsp page, I sessioned an durgCollection object on this jsp page using session.setAttribute("drugCollection",drugCollection);
there is a link on this jsp which will call a javascript to open a new window .
here is the javascript to open another new window:
function openReportWindow()
window.open("/drug/Report.jsp","report", "toolbar,scrollbars,width=800,height=800,left=100,top=10");
but in the Report.jsp, I won't be able to get the same session object as in the calling jsp ( drugsearch.jsp) by calling session.getAttribute("drugCollection").
if I change the link on drugsearch.jsp to link to the Report.jsp directly instead of opening a new window, then I can get the same session object from the Report.jsp.
what's the problem? can someone give me an advice?
thanksA session is assosiated with one client(browser).
when you open a new browser, a new session is created. In order to have common place for both the browsers, try storing the data in the 'Servlet Context'
Maybe you are looking for
-
Problem with xcompmgr and i3 window manager
Hey guys, Had a hard time trying to search for this problem. and nothing came up for the exact problem I was having. Anyways this is my problem. with xcompmgr is that it doesn't seem to be refreshing or something. it leaves trails of previous windows
-
How do I use my iPhone's hot spot to send email with Mail ?
Hi, My land line is dead ... so no phone nor internet at home. But I can use my iPhone'hot spot to get on the web from my iMac. Great ... it works ! Oups ! I cannot send email from my computer using my iPhone's hot spot with Mail. How do I do tha
-
HP-UX: Oracle AS 10g Reports server hangs
I have installed Oracle AS 10g Forms and reports services on HP-UX. Initially Forms and reports were working fine. Presently forms are also working fine. However reports started giving problem REP-56055: Exceed max connections allowed then changed th
-
If anyone has a solution for getting the Mecury Playpack Engine GPU acceleration to work with Premiere Pro CS6 on an iMAC 2011, please let me know. Like I wonder if you could Thunderbolt an External graphics card somehow? Or is an upgrade possible? A
-
hi All, I have an issue with $0 invoice, We have created $0 Sales order which is not picked by Autoinvoice concurrent program by automatically. For these we need to run manually. Please advise me know the reason why it is not picking. Instance is : 1