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!

Clueless on request.getContextPath()

859702Aug 29 2011 — edited Aug 31 2011
Hi, I am invoking the applet in a jsp as shown

<%
String contextPath=request.getContextPath();
%>


<APPLET CODE = "EmbeddedViewerApplet.class" CODEBASE = "<%=contextPath%>/applets" ARCHIVE = "ReportApplet.jar" WIDTH = "100%" HEIGHT = "90%"></XMP>
<PARAM NAME = CODE VALUE = "EmbeddedViewerApplet.class" >
<PARAM NAME = CODEBASE VALUE = "<%=contextPath%>/applets" >
<PARAM NAME = ARCHIVE VALUE = "ReportApplet.jar" >

<PARAM NAME="type" VALUE="application/x-java-applet;version=1.2.2">
<PARAM NAME="scriptable" VALUE="false">
<PARAM NAME = "REPORT_URL" VALUE ="<%=contextPath%>/GetJasperPrintObject">

</APPLET>


My server is running at the instance/context http://server/a/b where b is the context name

However, When I see the rendered HTML, the contextPath is printed with difference

At first line, it rendered /a/b/applets
At subsequent lines, it just printed /b/applets and /b/GetJasperPrintObject


Can you guys help in finding the error/problem with the code? Why is that the request.getContextPath() iis printing differently at different places?

Comments

necesariamente debes tener un dblink, es la mejor opción a la hora de conectar entre BD Oracle y tambien por seguridad, ya una vez hecho eso simplemente puedes consultar los datos de la siguiente manera select * from tablaRemota@dblinkName y listo;

L. Fernigrini

La mejor forma de hacerlo es mediante un DBLINK como ya mencionaron. Eso implica que el servidor (y la base de datos) actual obtengan acceso al segundo servidor / base de datos. Es la forma mas sencilla probablemente.
Muchas veces por mas que dos DB estén en servidores en la misma red, por políticas de seguridad no es posible que se vean entre ellos, en esos casos tendrías que desarrollar alguna aplicación que se ejecute en algún servidor/computadora que tenga acceso a ambos sistemas y que se encargue de obtener los datos de ambos y "unirlos". Esto normalmente es mas complejo pero puede ser una alternativa.
Aca hay una explicación bastante sencilla de como configurar un DBLINK
https://www.plsql.biz/2008/11/acceso-remoto-mediante-dblink-una-base.html

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

Post Details

Locked on Sep 28 2011
Added on Aug 29 2011
6 comments
292 views