Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

getElementById returns null in a JSP Page

843840Apr 1 2009 — edited Apr 1 2009
Hi everybody,

I've got a JSP page(A) that opens a popup window(B).
This one calls a Servlet

The servlet redirects to a jsp(C) maintaning A opened

In the first JSP(A) I've got
  <TR>
	  <TD colspan="10">
		<FONT color="red"><INPUT id="msgErrorCoperturaPolizza" style="border: none; color: red; font-weight: bold; background-color:#bed3df;" readonly="readonly" value="" size="100" ></FONT>
	  </TD>
  </TR>
In the jsp C I've got
<%
String errore = (String)session.getAttribute("erroreCoperturaPolizza");
		if(errore!=null)
		{
		%>
			alert('messaggio errore: '+top.opener.document.getElementById('msgErrorCoperturaPolizza').value);
			try{
				top.opener.document.getElementById('msgErrorCoperturaPolizza').value = '<%= errore %>';
			}catch(Exception){}
		
		<% } %>
The alert doesn't work but it works if I write:
			alert('messaggio errore: '+top.opener.document.getElementById('msgErrorCoperturaPolizza'));
and returns "messaggio errore: object"

Besides if I click CNTRL+N in the jsp C it returns NullPointerException:
java.lang.NullPointerException
	at java.lang.Throwable.<init>(Throwable.java)
	at java.lang.Throwable.<init>(Throwable.java)
	at java.lang.NullPointerException.<init>(NullPointerException.java:60)
	at org.apache.jsp._SisPragmaDett._jspService(SisPragmaDett.jsp  :78)
	at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
	at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:669)
	at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:767)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
	at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
	at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
	at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
	at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
	at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
	at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
	at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java)
	at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java)
	at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java)
	at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
	at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
	at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
	at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
	at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
	at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
	at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
	at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
	at com.ibm.ws.http.HttpConnection.run(HttpConnection.java)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
Thanks and regards

Comments

400695
have you downloaded java.com java virtual machine...?
152930
Hi Stephen,
Thank you for getting back to me!
As far as I know, I didn’t download this file. It is a new laptop with your typical programs (Office, Explorer, etc.) and Oracle Portal. Having said that, I will need to go home tonight and do a search. I’ll let you know. How does Java fit in the puzzle?

Thanks again!

Adrian
152930
Stephen,

I am just a novice. My installation of the portal and database includes many files called javavm. However, I was able to use the portal with no problems prior to my installation of McAfee.

Adrian
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 29 2009
Added on Apr 1 2009
1 comment
3,151 views