Java code on a customizable jsp

Greetings
does anybody know how should i place this code on a template for customizable pages??
<%!
String ip=CacheParametrosAplicacion.obtenerInstancia().obtenerDatoParametro("IP_CONTENT_CSS");
String puerto=CacheParametrosAplicacion.obtenerInstancia().obtenerDatoParametro("PUERTO_CONTENT_CSS");
String ruta=CacheParametrosAplicacion.obtenerInstancia().obtenerDatoParametro("RUTA_CSS");
String url = "http://"+ip+":"+puerto+ruta;
%>
i am getting this error when loading the created pages
Error de OracleJSP: oracle.jsp.parse.JavaCodeException: Número de Línea 3, oracle.jsp.parse.JspParseTagDeclaration@76a0fa
Error: Java code in jsp source files is not allowed in ojsp.next mod
Edited by: Luis_muxhaxho_betancourth on 3/08/2010 11:11 AM

Hum, I don´t think you can insert jsp code in an ADF page. Try creating a jsp page with the code you mentioned, then create an adf inline frame in your adf page and point to your jsp page using the src tag. Your jsp gets loaded inside the adf page. Hope this helps.

Similar Messages

  • Java code not working in Jsp page....

    I like to say to myself "there is no magic" when I come to a perplexing situation, today is one of those times.
    The following code when executed from the java class retrieves all the specified objects from the database and displays the requested attributes without issue:
    try {
    DBBody dbb = new DBBody();
    Entity[] allbods = dbb.retrieveAll(true);
    for(int k=0;k < allbods.length;k++) {
    Body body = (Body)allbods[k];
    System.out.println("From the dbase index position: " + k +" : " + "\n" + "Id: " + body.getId() + "\n" + "Type: " + body.getType() + "\n" + "Load: " + body.getLoad() + "\n XML:" + body.toXml() + "\n");
    dbb.close();
    } catch (Exception adb) {
    adb.printStackTrace();
    : the **exact same** code as displayed above when run in a Jsp only lists the values for the "body.getId()" and "body.getType()" methods...for a reason I can't discern, "body.getLoad()" and "body.toXml()" return empty strings in the Jsp. Everything else returns as when the code is run from the class. Both "getLoad()" and "toXml()" return strings but behind the scenes use StringBuffer objects that are converted to Strings...getId() returns an int and "getType()" returns a String also, but for whatever reason (to repeat) only those two attributes come through IN THE JSP, in the class ALL attributes are retrieved without a problem...so, what is wrong with Jsp? Java? I get no error message what so ever, just empty strings for the two specified method returns...what am I overlooking. I am running the embedded Jsp engine of the Jetty Http Server that I've incorporated into my application, which uses the latest Jsp version.
    Any help on this issue would be greatly appreciated.

    If you dont want to paste your code, then you will
    certainly not get any responses from the so called
    Java Engineers rest is left to you. We can get dukes
    elsewhere instead.
    SwarajSwaraj, I apologize if I was taken to be abrassive with my last comment, I myself am a java engineer so I have no animosity, as for your request to copy the entire code it is no longer needed I have solved the problem and the solution follows just incase anyone else runs into similar issues. It indeed had nothing to do with StringBuffer working improperly but rather it was how I was getting my dbase connection.
    As many of you who have developed applications with jdbc support to popular dbase vendors may already know, a connection must be established to the database by specifying various parameters, namely the name of the jdbc connection driver classes for the desired vendor (eg. "com.microsoft.jdbc.sqlserver.SQLServerDriver" for MS Sql Server instances) and the driver specific db connection url. Of course the driver classes must be available on the class path so that they can be accessed. Without these parameters the connection will not be initialized..well it turns out my "bug" was caused by my inadvertently ommitting the connection parameters in my Jsp, you might wonder "but you said it executed fine in the jsp except for the missing "getBody()" and "toXml()" results..how could it even execute at all if you didn't establish a connection?"
    The answer is I designed the application to use a default connection driver class (the jdbc odbc bridge driver) and a default connection url (one that is tied to my testing instance of MsSqlServer2000) it turns out that the jdbc odbc bridge is very light weight...it lacks support for certain very useful MsSql datatypes namely "ntext", I use the "ntext" type for fields that can grow to any size (stylesheet code,xml code...etc.) but the bridge driver doesn't support "ntext" BUT rather than throw an exception error like proper error handling would require it silently eats the request (very very bad) ...this exacerbated the problem I had significantly (had it thrown an error I would have known immediately that the connection was using the wrong driver and url and fixed it sooner) as it is ...I was led down blind allies thinking my code was faulty, (which it wasn't strictly speaking ..I was just missing some extra code to account for the possibility that the bridge driver is instantiated by accident) so after adding the following code above the Jsp code shown previously:
    //Configure a connection to a Microsoft Sql Database.
    DBConfig.setVendorId(DBConfig.MSSQL_VID);
    DBConfig.setDBHostId("xiassql");
    DBConfig.setDBHostPort("1433");
    DBConfig.setDBUrl(DBConfig.buildDBUrl());
    :The code worked perfectly. The "DBConfig" class does exactly that..allowing me to pass in connection attributes including the type of vendor "DBConfig.MSSQL_VID", (I have built in support for 5 popular vendors so far), the dbase host name "xiassql" and the port "1433" , then we build the url using the specified attributes and the connection is complete. After adding the code above the Jsp returned all the retrieved values perfectly. So, when testing applications that enable backend dbase connections if you get seemingly identical code behaving differently from class to Jsp, suspect an issue relating to your connection url and classes (assuming you have multiple support and a default value as I do in my app.) also any changes in the execution context from class to Jsp can cause similar errors (like not declaring the same classes at the top of the Jsp file , or less likely using an outdated Jsp engine!)
    Regards,
    PS I will take off the Duke Dollars on this question since I answered it myself!

  • In Struts is it possible to use java code  in jsp?

    in Struts Tag Program in jsp pages is it efficient to use java code? Please explain?

    No issues.. you can use java code... in jsp struts
    based framework..
    SJYou can use Java code as scriptlets in any JSP, but that doesn't mean there are no issues.
    I would say it's a bad idea for the following reasons:
    (1) Scriptlet code is difficult to read when mingled with HTML
    (2) You can't unit test scriptlet code
    (3) It increases the chance that business logic will leak into pages where it doesn't belong.
    Better to use a well-proven tag library like JSTL or the Struts taglibs and keep all scriptlets out of your JSPs.
    %

  • Passing drop down value to java code

    Hi,
    I am using a htmlb dropdownlist element in a jsp file. And I have included the java code in the same jsp. I need to know how to pass the selected value from the drop down to the java code.
    Can anyone please help?
    Thanks & regards,
    Malita Fernandes

    Not a problem, please create a java bean class which is having setter and getter methods
    for example if you drop down name is Day and create bean class like
    public class week
               private Day;
               public void setDay(String day){
               this.Day=day;
               public String getDay() {
          return this.Day;
    JSP File
    <SELECT name=Day>
    <OPTION value="" selected>- Select -</OPTION>
    <OPTION value=Sunday>Sunday</OPTION>
    <OPTION value=Monday>Monday</OPTION>
    <OPTION value=Tuesday>Tuesday</OPTION>
    <OPTION value=Wednesday>Wednesday</OPTION>
    <OPTION value=Thursday>Thursday</OPTION>
    <OPTION value=Friday>Friday</OPTION>
    <OPTION value=Saturday>Saturday</OPTION>
    </SELECT>
    <% week w=new week();
    w.setDay(Day);  %>

  • Java code in jsp source files is not allowed in ojsp.next mode.

    Hi,
    I’m working on WC Spaces Customization library “com.acme.custom.webcenter.spaces.war”. From time to time, when I deploy the library to WC Server, it errors out.
    weblogic.management.DeploymentException: Cannot undeploy library Extension-Name: com.acme.custom.webcenter.spaces, Specification-Version: 11.1.1, Implementation-Version: 11.1.1.2.113 from server WC_Spaces, because the following deployed applications reference it: webcenter-rest.war, spaces.war, sharepoint-servlet.war, webcenter-rss.war
    If I try to login the Spaces, I get “Java code in jsp source files is not allowed in ojsp.next mode.” Should I stop the Spaces server before the deployment? In this case, other people won’t have accesses to Spaces? The deployment error doesn’t happen all the time.
    oracle.jsp.parse.JavaCodeException: Line # 6, oracle.jsp.parse.JspParseTagScriptlet@5b9864ca
    Error: Java code in jsp source files is not allowed in ojsp.next mode.
    at oracle.jsp.parse.JspParseTagCore.createNode(JspParseTagCore.java:263)
    at oracle.jsp.parse.JspUtils.createChildNodes(JspUtils.java:2489)
    at oracle.jsp.parse.JspParseTagFile.createTree(JspParseTagFile.java:475)
    at oracle.jsp.parse.OracleJsp2Java.transformImpl(OracleJsp2Java.java:535)
    at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:593)
    at oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:691)
    at oracle.jsp.runtimev2.JspPageCompiler.compileBothModes(JspPageCompiler.java:490)
    at oracle.jsp.runtimev2.JspPageCompiler.parseAndGetTreeNode(JspPageCompiler.java:457)
    at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:624)
    at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:645)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:385)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:802)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:726)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    Buildfile: C:\JDeveloper\mywork\LamwWebCenterSpacesExtensions\WebCenterSpacesSharedLibExtension\build.xml
    =======
    init-wls:
    deploy-shared-lib:
    [echo] ----------------------------
    [echo] C:\JDeveloper\mywork\myuserconfigfile.secure C:\JDeveloper\mywork\myuserkeyfile.secure claptd01:7001 C:\JDeveloper\mywork\XxxWebCenterSpacesExtensions/WebCenterSpacesSharedLibExtension/deploy/exploded WC_Spaces com.acme.custom.webcenter.spaces
    [exec]
    [exec] CLASSPATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1.5\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~1.5\modules\NETSFA~1.0_1/lib/ant-contrib.jar;.;%JAVA_HOME\jre\lib;C:\Apache\apache-cxf\lib;C:\Apache\apache-cxf\lib\cxf-manifest.jar;.\build\classes;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\oracle\MIDDLE~1.5\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar
    [exec]
    [exec] PATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\native;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\native;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\native\win\32;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1\bin;C:\oracle\MIDDLE~1.5\JDK160~1\jre\bin;C:\oracle\MIDDLE~1.5\JDK160~1\bin;C:\Program Files\PHP52\;C:\Program Files\Common Files\OTG;C:\oracle\product\10.2.0\client_1\bin;C:\oracle\ora_adi\bin;C:\PROGRA~1\REFLEC~1;C:\Program Files\Reflection;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;E:\MSSQL7\BINN;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\glassfish3\jdk\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Vim\vim73;c:\apache\ant\bin;c:\jboss\bin;C:\Apache\apache-cxf\bin;C:\glassfish\bin;C:\Program Files\QuickTime\QTSystem\;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\native\win\32\oci920_8
    [exec]
    [exec] Your environment has been set.
    [exec]
    [exec] CLASSPATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1.5\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~1.5\modules\NETSFA~1.0_1/lib/ant-contrib.jar;.;%JAVA_HOME\jre\lib;C:\Apache\apache-cxf\lib;C:\Apache\apache-cxf\lib\cxf-manifest.jar;.\build\classes;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\oracle\MIDDLE~1.5\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar;C:\oracle\MIDDLE~1.5\utils\config\10.3\config-launch.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbynet.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbytools.jar;;
    [exec]
    [exec] Initializing WebLogic Scripting Tool (WLST) ...
    [exec]
    [exec] Welcome to WebLogic Server Administration Scripting Shell
    [exec]
    [exec] Type help() for help on available commands
    [exec]
    [exec]
    [exec] Deploy started at Wed Mar 28 12:25:08 2012
    [exec]
    [exec] Connecting to t3://claptd01:7001 with userid weblogic ...
    [exec] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.
    [exec]
    [exec] Warning: An insecure protocol was used to connect to the
    [exec] server. To ensure on-the-wire security, the SSL port or
    [exec] Admin port should be used instead.
    [exec]
    [exec] Location changed to edit tree. This is a writable tree with
    [exec] DomainMBean as the root. To make changes you will need to start
    [exec] an edit session via startEdit().
    [exec]
    [exec] For more help, use help(edit)
    [exec] You already have an edit session in progress and hence WLST will
    [exec] continue with your edit session.
    [exec]
    [exec] Starting an edit session ...
    [exec] Started edit session, please be sure to save and activate your
    [exec] changes once you are done.
    [exec] Deploying application from C:\JDeveloper\mywork\XxxWebCenterSpacesExtensions\WebCenterSpacesSharedLibExtension\deploy\exploded\com.acme.custom.webcenter.spaces.war to targets WC_Spaces (upload=true) ...
    [exec] <Mar 28, 2012 12:25:10 PM EDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, com.acme.custom.webcenter.spaces [archive: C:\JDeveloper\mywork\XxxWebCenterSpacesExtensions\WebCenterSpacesSharedLibExtension\deploy\exploded\com.acme.custom.webcenter.spaces.war], to WC_Spaces .>
    [exec] You have an edit session in progress, hence WLST will not
    [exec] block for your deployment to complete.
    [exec] Started the Deployment of Application. Please refer to the returned WLSTProgress object or variable LAST to track the status.
    [exec]
    [exec] ### ### ###: Deploy done
    [exec]
    [exec] 0
    [exec]
    [exec] ### ### ###: Status of Deploy
    [exec]
    [exec] Current Status of your Deployment:
    [exec] Deployment command type: deploy
    [exec] Deployment State : running
    [exec] Deployment Message : [Deployer:149140]The task cannot be processed further until the current edit session is activated. When this occurs, task processing will continue. The user can exit the deployer tool without affecting the task.
    [exec]
    [exec]
    [exec] ### ### ###: Saving
    [exec]
    [exec] Saving all your changes ...
    [exec] Saved all your changes successfully.
    [exec]
    [exec] ### ### ###: Activating
    [exec]
    [exec] Activating all your changes, this may take a while ...
    [exec] The edit lock associated with this edit session is released
    [exec] once the activation is completed.
    [exec] This Exception occurred at Wed Mar 28 12:25:18 EDT 2012.
    [exec] weblogic.management.DeploymentException: Cannot undeploy library Extension-Name: com.acme.custom.webcenter.spaces, Specification-Version: 11.1.1, Implementation-Version: 11.1.1.2.113 from server WC_Spaces, because the following deployed applications reference it: webcenter-rest.war, spaces.war, sharepoint-servlet.war, webcenter-rss.war
    [exec]      at weblogic.deploy.event.DeploymentEventManager.sendVetoableDeploymentEvent(DeploymentEventManager.java:337)
    [exec]      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.fireVetoableDeploymentEvent(AbstractOperation.java:781)
    [exec]      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:216)
    [exec]      at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
    [exec]      at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
    [exec]      at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
    [exec]      at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
    [exec]      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
    [exec]      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
    [exec]      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
    [exec]      at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
    [exec]      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    [exec]      at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    [exec] Caused by: weblogic.deploy.event.DeploymentVetoException: Cannot undeploy library Extension-Name: com.acme.custom.webcenter.spaces, Specification-Version: 11.1.1, Implementation-Version: 11.1.1.2.113 from server WC_Spaces, because the following deployed applications reference it: webcenter-rest.war, spaces.war, sharepoint-servlet.war, webcenter-rss.war
    [exec]      at weblogic.application.library.LibraryDeploymentListener.verifyLibrary(LibraryDeploymentListener.java:123)
    [exec]      at weblogic.application.library.LibraryDeploymentListener.vetoableApplicationActivate(LibraryDeploymentListener.java:58)
    [exec]      at weblogic.application.library.LibraryDeploymentListener.vetoableApplicationDeploy(LibraryDeploymentListener.java:64)
    [exec]      at weblogic.deploy.event.VetoableDeploymentEvent$2.notifyListener(VetoableDeploymentEvent.java:70)
    [exec]      at weblogic.deploy.event.DeploymentEventManager.sendVetoableDeploymentEvent(DeploymentEventManager.java:335)
    [exec] None
    [exec] #########################################################
    [exec] ##### Deployment Failed #########
    [exec] ##### Contact support with Exception Stack #########
    [exec] #########################################################
    [exec]
    [exec]
    [exec] Exiting WebLogic Scripting Tool.
    [exec]
    [exec] <Mar 28, 2012 12:25:18 PM EDT> <Warning> <JNDI> <BEA-050001> <WLContext.close() was called in a different thread than the one in which it was created.>
    [echo] ----------------------------
    [echo] Restarting the app
    [echo] ----------------------------
    [exec]
    [exec] CLASSPATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1.5\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~1.5\modules\NETSFA~1.0_1/lib/ant-contrib.jar;.;%JAVA_HOME\jre\lib;C:\Apache\apache-cxf\lib;C:\Apache\apache-cxf\lib\cxf-manifest.jar;.\build\classes;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\oracle\MIDDLE~1.5\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar
    [exec]
    [exec] PATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\native;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\native;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\native\win\32;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1\bin;C:\oracle\MIDDLE~1.5\JDK160~1\jre\bin;C:\oracle\MIDDLE~1.5\JDK160~1\bin;C:\Program Files\PHP52\;C:\Program Files\Common Files\OTG;C:\oracle\product\10.2.0\client_1\bin;C:\oracle\ora_adi\bin;C:\PROGRA~1\REFLEC~1;C:\Program Files\Reflection;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;E:\MSSQL7\BINN;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\glassfish3\jdk\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Vim\vim73;c:\apache\ant\bin;c:\jboss\bin;C:\Apache\apache-cxf\bin;C:\glassfish\bin;C:\Program Files\QuickTime\QTSystem\;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\native\win\32\oci920_8
    [exec]
    [exec] Your environment has been set.
    [exec]
    [exec] CLASSPATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1.5\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~1.5\modules\NETSFA~1.0_1/lib/ant-contrib.jar;.;%JAVA_HOME\jre\lib;C:\Apache\apache-cxf\lib;C:\Apache\apache-cxf\lib\cxf-manifest.jar;.\build\classes;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\oracle\MIDDLE~1.5\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar;C:\oracle\MIDDLE~1.5\utils\config\10.3\config-launch.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbynet.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbytools.jar;;
    [exec]
    [exec] Initializing WebLogic Scripting Tool (WLST) ...
    [exec]
    [exec] Welcome to WebLogic Server Administration Scripting Shell
    [exec]
    [exec] Type help() for help on available commands
    [exec]
    [exec]
    [exec] Redeploy of Spaces Application started at Wed Mar 28 12:25:21 2012
    [exec]
    [exec] Connecting to t3://claptd01:7001 with userid weblogic ...
    [exec] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.
    [exec]
    [exec] Warning: An insecure protocol was used to connect to the
    [exec] server. To ensure on-the-wire security, the SSL port or
    [exec] Admin port should be used instead.
    [exec]
    [exec] Redeploying application webcenter ...
    [exec] <Mar 28, 2012 12:25:28 PM EDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating redeploy operation for application, webcenter#11.1.1.4.0 [archive: null], to WC_Spaces .>
    [exec] [Deployer:149140]The task cannot be processed further until the current edit session is activated. When this occurs, task processing will continue. The user can exit the deployer tool without affecting the task.
    [exec] ..........................................Failed to redeploy the application with status failed
    [exec] Current Status of your Deployment:
    [exec] Deployment command type: redeploy
    [exec] Deployment State : failed
    [exec] Deployment Message : java.lang.Exception: [DeploymentService:290036]Deployment for request id '1332951945158' is deferred since target 'WC_Spaces' is disconnected.
    [exec] No stack trace available.
    [exec] None
    [exec] #########################################################
    [exec] ##### ReDeploy Spaces Failed #########
    [exec] ##### Contact support with Exception Stack #########
    [exec] #########################################################
    [exec]
    [exec]
    [exec] Exiting WebLogic Scripting Tool.
    [exec]
    [exec] <Mar 28, 2012 12:27:34 PM EDT> <Warning> <JNDI> <BEA-050001> <WLContext.close() was called in a different thread than the one in which it was created.>
    BUILD SUCCESSFUL
    Total time: 2 minutes 31 seconds
    Edited by: 891549 on Mar 29, 2012 12:01 PM

    I don't think that this error is based on ojsp.next mode. The first error I see is that the application can't be undeployed. After that you get the 'ava code in jsp source files is not allowed in ojsp.next mode.' error. As you said this only happens sometimes which also point to an other problem and not to the jsp error.
    Have you ask this on the {forum:id=354} forum?
    For me it's more a deployment/redeployment question.
    Timo

  • Test.jsp not able to display the output from the java code.

    when i try to invoke http://localhost/papz/test.jsp
    I dont see anything. The page is blank. And there are no error messages in any log files. When i click on view source in IE i get to see the entire source code, including the jave code.
    <html>
    <head>
    <title>Test</title>
    <body>
    <%
    out.println("Hello World");
    %>
    asdfasdfasdf
    </body>
    </html>
    i added in the asdfasdf to see whehter it will be printed or not... It does print that stuff out.
    when i try to invoke the login.jsp page, i get the dialog box "save this file to disk"
    Any clues whats going on...?
    I followed the instructions...over and over again... but it doesnt seem to help.
    win nt 4.0
    apache 1.3.12
    jserv 1.1.1
    Pls help. Thanks

    Hi,
    Have you solved your problem?
    I4m trying to do the same, but I installed portal 30, then portal to go, and when I try to run test.jsp I get the following error:
    Request URI:/papz/test.jsp
    Exception:
    java.lang.NoSuchMethodError: oracle.jsp.util.JspUtil: method
    stripTarget(Ljava/lang/String;C)Ljava/lang/String; not found
    Thanks
    Pablo Lopera
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by NewBie:
    when i try to invoke http://localhost/papz/test.jsp
    I dont see anything. The page is blank. And there are no error messages in any log files. When i click on view source in IE i get to see the entire source code, including the jave code.
    <html>
    <head>
    <title>Test</title>
    <body>
    <%
    out.println("Hello World");
    %>
    asdfasdfasdf
    </body>
    </html>
    i added in the asdfasdf to see whehter it will be printed or not... It does print that stuff out.
    when i try to invoke the login.jsp page, i get the dialog box "save this file to disk"
    Any clues whats going on...?
    I followed the instructions...over and over again... but it doesnt seem to help.
    win nt 4.0
    apache 1.3.12
    jserv 1.1.1
    Pls help. Thanks<HR></BLOCKQUOTE>
    null

  • Working fine with JAVA code and Error Occured while using in JSP

    Hi.....
    When initiating a BPEL process from JAVA the code is working fine and the Process is getting initiated.But while using that code in J2EE project as a java code and while calling that method Error is occuring.....
    Here by i am attaching my JAVA Code which runs as an applicateion and package which runs in Server....
    JAVA Code (Run as Application) Working Fine:
    package bo;
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.NormalizedMessage;
    import com.oracle.bpel.client.delivery.IDeliveryService;
    import java.util.Map;
    import java.util.Properties;
    import oracle.xml.parser.v2.XMLElement;
    /*import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest ;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession; */
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class processit {
         public static void main(String args[]){
              String input = "TATA";
              String xmlInput= "<ns1:AccessDBBPELProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/AccessDBBPEL\"><ns1:input>"+input+"</ns1:input></ns1:AccessDBBPELProcessRequest>";
              String xml="<ns1:BPELProcess1ProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/BPELProcess1\">";
              xml=xml+"<ns1:input>"+input+"</ns1:input>";
              xml=xml+"</ns1:BPELProcess1ProcessRequest>";
              try{
              Properties props=new Properties();
              props.setProperty("orabpel.platform","ias_10g");
              props.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
              props.setProperty("java.naming.provider.url","opmn:ormi://157.227.132.226:6003:home/orabpel");
              props.setProperty("java.naming.security.principal","oc4jadmin");
              props.setProperty("java.naming.security.credentials","oc4jadmin");
              props.setProperty("dedicated.rmicontext", "true");
              Locator locator = new Locator("default", "bpel", props);
              System.out.println("After creating the locator object......");
              IDeliveryService deliveryService =(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME);
              System.out.println("Before creating the NormalizedMessage object......");
              NormalizedMessage nm = new NormalizedMessage();
              System.out.println("After creating the NormalizedMessage object.*.*.*...");
              nm.addPart("payload", xml);
              System.out.println("Before creating response object......");
              NormalizedMessage res = deliveryService.request("BPELProcess1", "process", nm);
              System.out.println("After calling the BPELProcess1 .*.*.*...");
              Map payload = res.getPayload();
              System.out.println("BPEL called");
              XMLElement xmlEl=(oracle.xml.parser.v2.XMLElement)payload.get("payload");
              String replyText=xmlEl.getText();
              System.out.println("Reply from BPEL Process>>>>>>>>>>>>> "+replyText);
              catch (Exception e) {
              System.out.println("Exception : "+e);
              e.printStackTrace();
    JSP and Java Method Used:
    JSP Code:
    ===============
    <%@ page import=" bo.callbpel" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>FEATT - I30</title>
    </head>
    <body>
    <%
    String input=request.getParameter("dnvalue");
    callbpel p=new callbpel();
    String Output=p.Initiate(input);
    out.print("The Input Given to the BPEL Process is : "+input);
    %>
    <BR><BR><BR><BR><BR><BR>
    <%
    out.print("The Reply from BPEL Process is : "+Output);
    %>
    </body>
    </html>
    Java Code:
    package bo;
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.NormalizedMessage;
    import com.oracle.bpel.client.delivery.IDeliveryService;
    import java.util.Map;
    import java.util.Properties;
    import oracle.xml.parser.v2.XMLElement;
    /*import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest ;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession; */
    //import java.util.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class callbpel {
         public String Initiate(String value){
              String replyText=null;
              String input = value;
              System.out.println(input);
              String xmlInput= "<ns1:AccessDBBPELProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/AccessDBBPEL\"><ns1:input>"+input+"</ns1:input></ns1:AccessDBBPELProcessRequest>";
              String xml="<ns1:BPELProcess1ProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/BPELProcess1\">";
              xml=xml+"<ns1:input>"+input+"</ns1:input>";
              xml=xml+"</ns1:BPELProcess1ProcessRequest>";
              try{
              Properties props=new Properties();
              props.setProperty("orabpel.platform","ias_10g");
              props.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
              props.setProperty("java.naming.provider.url","opmn:ormi://157.227.132.226:6003:home/orabpel");
              props.setProperty("java.naming.security.principal","oc4jadmin");
              props.setProperty("java.naming.security.credentials","oc4jadmin");
              props.setProperty("dedicated.rmicontext", "true");
              Locator locator = new Locator("default", "bpel", props);
              String uniqueBpelId = com.collaxa.cube.util.GUIDGenerator.generateGUID();
              //System.out.println(uniqueBpelId);
              //java.util.Map msgProps = new HashMap();
              System.out.println("After creating the locator object......");
              IDeliveryService deliveryService =(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME);
              System.out.println("Before creating the NormalizedMessage object......");
              NormalizedMessage nm = new NormalizedMessage();
              System.out.println("After creating the NormalizedMessage object.*.*.*...");
              //msgProps.put("conversationId",uniqueBpelId);
              //nm.setProperty("conversationId",uniqueBpelId);
              nm.addPart("payload", xml);
              System.out.println("Before creating response object......");
              NormalizedMessage res = deliveryService.request("BPELProcess1", "process", nm);
              System.out.println("After calling the BPELProcess1 .*.*.*...");
              Map payload = res.getPayload();
              System.out.println("BPEL called");
              XMLElement xmlEl=(oracle.xml.parser.v2.XMLElement)payload.get("payload");
              replyText=xmlEl.getText();
              System.out.println("Reply from BPEL Process>>>>>>>>>>>>> "+replyText);
              catch (Exception e) {
              System.out.println("Exception : "+e);
              e.printStackTrace();
              return replyText;
    While Creating and Object for the Class callbpel and Whilw Calling that Method
    callbpel p=new callbpel();
    String Output=p.Initiate(input);
    Its throwing an Error:
    Error Occured is:
    After creating the locator object......
    Before creating the NormalizedMessage object......
    After creating the NormalizedMessage object.*.*.*...
    Before creating response object......
    Apr 24, 2008 9:12:00 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.NoClassDefFoundError: javax/ejb/EJBException
         at com.oracle.bpel.client.util.ExceptionUtils.handleServerException(ExceptionUtils.java:76)
         at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:254)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
         at bo.callbpel.Initiate(callbpel.java:55)
         at org.apache.jsp.output_jsp._jspService(output_jsp.java:55)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
         at java.lang.Thread.run(Unknown Source)
    For Running JSP i am Using Eclipse 3.2.0 and apache-tomcat-5.5.25
    Please Provide me a Solution......
    Thanks in Advance.....
    Regards,
    Suresh K

    A JSP is not the same as a Java application. A Java application has package statment, import statements, try/catch block, a JSP doesn't.

  • Writing java code in JSP

    Hi All
    I dont know which one of the following is more effective in JSP
    writing java code like <% out.println("Hellooo "); %>
    OR
    writing like <%="hello" %>
    I shall be very much thankful to all those who spare their valuable time to clarify my doubt. I hope my question is not a stupid one.
    Thanks
    Elisha

    when both gives the same out put, why there are two for the same out put?Because it is easier to do this:
    Hello <%= userName %>
    than this:
    Hello <% out.println("userName"); %>
    Also there is a BIG difference in readability and maintainability of the JSP page. JSP pages are all about having html, and a few "fill in the blank" spots. The less <% scriptlet code %> you put on your JSP page, the better. If you want to run java code, do it in a servlet/bean.
    With the advent of JSTL, scriptlet code in JSPs should be a thing of the past.

  • SQL in JSP - do I use JAVA code in % ... % or SQL Tag Library ??

    I have a small web app that makes needs to make about 12 SQL queries in a JSP and am trying to figure out what is the best way to do this
    I had initially coded this using plain JAVA code in the JSP as follows :-
    <%
    Connection conn = null;
    Statement st = null;
    ResultSet rs = null;
    try {
    st = conn.createStatement();
    rs = st.executeQuery("select .........");
    %>
    But then I came across the SQL Tag Library in an article and wonder if this is more efficient code?
    If so does anyone have a pointer to a good intro to these tags as they look complicated (I only am doing queries on the SQL database, no inserts or updates)

    Sometimes you've gotta do what you've gotta do.
    My rule is "no scriptlets".
    If you MUST access a database from a JSP, the only right way to do it is to use JSTL <sql> tags.
    %

  • Pass the data back from the jsp page to the java code

    Hi,
    I have written an iView that receives an event using EPCF and extracts data from the client data bag.
    I need this iView to pass the data back from the jsp page to the java code.
    I am trying to do this using a hidden input field, but I cannot get the code to work.
    Here is the code on the jsp page.
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <hbj:content id="myContext" >
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId">
    <hbj:inputField id="myInputField" type="string" maxlength="100" value="" jsObjectNeeded="true">
    <% myInputField.setVisible(false);%>
    </hbj:inputField>      
       </hbj:form>
      </hbj:page>
    </hbj:content>
    <script language=JavaScript>
    EPCM.subscribeEvent("urn:com.peter", "namedata", window, "eventReceiver");
    function eventReceiver(eventObj) {
         var url = eventObj.dataObject;
         var funcName = htmlb_formid+"_getHtmlbElementId";
         func = window[funcName];
         var ipField = eval(func("myInputField"));
         ipField.setValue(url);
         var form = document.all(htmlb_formid);
         form.submit();
    </script> 
    Here is my java code
    package com.sap.training.portal;
    import com.sapportals.htmlb.InputField;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    public class ListSalesOrder extends PageProcessorComponent {
      public DynPage getPage(){
        return new ListSalesOrderDynPage();
      public static class ListSalesOrderDynPage extends JSPDynPage{
         private String merong;
        public void doInitialization(){
        public void doProcessAfterInput() throws PageException {
              InputField reportfld = (InputField) getComponentByName("myInputField");
              if (reportfld != null)      merong = reportfld.getValueAsDataType().toString();
        public void doProcessBeforeOutput() throws PageException {
              if ( merong != null ) setJspName("merong.jsp");
              else setJspName("ListSalesOrder.jsp");
    Here is DD
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="SharingReference" value="com.sap.portal.htmlb"/>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
      </application-config>
      <components>
        <component name="SearchSalesOrder">
          <component-config>
            <property name="ComponentType" value="jspnative"/>
            <property name="JSP" value="/pagelet/SearchSalesOrder.jsp"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
        <component name="ListSalesOrder">
          <component-config>
            <property name="ClassName" value="com.sap.training.portal.ListSalesOrder"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
      </components>
      <services/>
    </application>
    After receive event, then call java script function "eventReceiver" and call "form.submit()".
    But .. PAI Logic in Java code doesn't called ...
    Where is my problme ?
    Help me ...
    Regards, Arnold.

    Hi Arnold,
    you should not do a form.submit yourself. Instead you can put a component called ExternalSubmit to your page:
    ExternalSubmit exSubmit = new ExternalSubmit("EX_SUBMIT"));
    exSubmit.setServerEventName("MyEvent");
    This results in a java script funtion on the page which is called "_htmlb_external_submit_". If you call this function the the form gets submitted and your event handler is called.
    regards,
    Martin

  • Java code and jsp interaction

    Hi,
    How does one interact between java code and jsp page.That is, if the java code does say database connection, the web page should tell that the connection has been made,just like an application but this will work on the web server not in the console.Kindly let me know.
    As

    Just curious but where do these questions come from? A course you are taking or you are building something for a hobby?
    If you are building some small simple web-app it's probably quicker to embed code right onto your JSP page.
    There are various levels of abstracting your web-app separating display from logic from the model.
    The following are techniques from simple web-apps to more complicated ones.
    -Embedding script right into your JSP
    -Using beans
    -Using custom tags ( I think there are some standard ones now, struts seems to be a popular buzzword)
    -Including a servlet to handle your requests redirect, update bean content grab info form your database and forward to a JSP. (Read up on model 2 architecture.)
    To include as much detail as possible would be to write a book. Fortunately many have so I don't have to fit one in this tiny reply box.
    Hope that was somewhat useful.

  • Calling Java code inside JSP page and sending toString on object to Servlet

    Hi.
    I am trying to setup a way to make testing my application easier. Using a web-based method will work best. Here is what I am trying to accomplish:
    - Have a web page that will prompt the user to enter data, fill in text fields, make choices, etc. When done, they press the Submit button. I don't need to keep info between sessions. Just open browser, execute, view results, close browser, repeat.
    - I then want to take this data and use some Java Classes I have to create a Java object.
    - I then want to send the toString() results of this Java object to a known Java servlet. The result of the servlet's actions should be displayed as a response on the screen.
    This is what I currently have (Ignore the
    's - I don't know why they are showing up - its not important):
    Web page:
    <html>
    <head><title>TestGroup</title></head>
    <body>
    <form name=f method=post action=http://localhost:100/Servlet>
    Name: <br>
    Group: <input name=group type=text><br>
    <br>
    <input type=submit value=Submit>
    <input type=reset value=Reset>
    </form>
    </body>
    </html>The Java code in the JSP (where to put it?):
    <%
    Group g = new Group();
    g.setGroupName(request.getParameter("group"));
    String output = g.toString(); // I want this to go to the Servlet.
    %>But, now I am stuck as to how to piece these together. I have some JSP experience, but not quite like this.
    As I said, when the user presses the Submit button, I want to perform the Java code above, and have the results of the toString method sent to the Servlet, plus clear all other parameters (so they are not sent to the servlet).
    Does anyone have any advice/comments? I am open to alternative designs too, this is just the simplest one I could think of. If another JSP page is needed, that's fine too.
    Thanks.

    Hi.
    I am trying to setup a way to make testing my application easier. Using a web-based method will work best. Here is what I am trying to accomplish:
    - Have a web page that will prompt the user to enter data, fill in text fields, make choices, etc. When done, they press the Submit button. I don't need to keep info between sessions. Just open browser, execute, view results, close browser, repeat.
    - I then want to take this data and use some Java Classes I have to create a Java object.
    - I then want to send the toString() results of this Java object to a known Java servlet. The result of the servlet's actions should be displayed as a response on the screen.
    This is what I currently have (Ignore the
    's - I don't know why they are showing up - its not important):
    Web page:
    <html>
    <head><title>TestGroup</title></head>
    <body>
    <form name=f method=post action=http://localhost:100/Servlet>
    Name: <br>
    Group: <input name=group type=text><br>
    <br>
    <input type=submit value=Submit>
    <input type=reset value=Reset>
    </form>
    </body>
    </html>The Java code in the JSP (where to put it?):
    <%
    Group g = new Group();
    g.setGroupName(request.getParameter("group"));
    String output = g.toString(); // I want this to go to the Servlet.
    %>But, now I am stuck as to how to piece these together. I have some JSP experience, but not quite like this.
    As I said, when the user presses the Submit button, I want to perform the Java code above, and have the results of the toString method sent to the Servlet, plus clear all other parameters (so they are not sent to the servlet).
    Does anyone have any advice/comments? I am open to alternative designs too, this is just the simplest one I could think of. If another JSP page is needed, that's fine too.
    Thanks.

  • Using jsp variable in java code

    Hey guys,
    I need some help hope you guys can help me.
    I've declared a variable "error" in a jsp. how do I access this variable in the java code whice resides in the same jsp page.
    I know I can use java variable in jsp code using
    <%= sVariable %>
    where sVariable was declared in the java code. but how do I access a jsp variable in java code??
    Thanks very much in advance

    Thanks for the reply.
    This is what I want to do.
    I've declared a variable "error" using <c:catch var="error">I want to check the value of this variable and suppose if it contains XYZ (error variable will have a long string so I just want to check if it contains a specific value) I want to do step1 and if the variable of error is not XYZ I want to do step 2
    Problem is I dont know how to check if error contains the XYZ in jsp thats why I thought java code would help here.
    Can you guys suggest a better way to solve my problem.
    Thanks again

  • Interpreting JSP code in Java code

    Hi,
         I am writing a scheduler to generate emails based on certain events.
    The email body constructed using HTML. I was constructing the HTML string
    for the body using string concats. Its quickly becoming untenable to
    maintain the code whenever I have to make changes to email body.
    I thinking of using JSP based templates. [ I have access to all the tomcat jar files in my program]
         I have following question in this context:
         Can I parse/compile the JSP file in the java code and invoke the
    resultant class with my input variable's) to get a output stream?
    E.g.: Lets say I have a JSP template as shown below:
    <HTML>
    <TABLE >
    <TR>
    <TD>Name:</TD>
    <TD>Telephone number:</TD>
    </TR>
    <%
    for ( int i = 0; i < input.size(); i++)
    %>
    <TR>
    <TD>
    <%=(Contacts)input.getName()%>
    </TD>
    <TD>
    <%=(Contacts)input[i].getTelephonenumber()%>
    </TD>
    </TR>
    <%
    %>
    </TABLE >
    </HTML>
    I want to execute the JSP with some input in my java method and get the resultant HTML string.
    Is its possible to do this? Or is there a better way of doing this?
    Thanks
    mg

    Sorry didn't read that properly.
    If you are sending emails using javamail, you can specify a URL datasource:
    Can't promise this code will work out of the box, but it may give a couple of ideas...
    I was sending an attachment with this mail, and I've chopped that bit out.
    // Create message
    MimeMessage message = new MimeMessage(session);
    message.setFrom(new InternetAddress("[email protected]"));
    InternetAddress addr = new InternetAddress();
    message.addRecipients(Message.RecipientType.TO, email);
    message.setSubject(mailSubject);
    Multipart multipart = new MimeMultipart();
    // The important part - reading the body of the message from a URL.
    URL url = new URL("http://urlToGenerateTheEmailAutomatically");
    DataSource source = new URLDataSource(url);
    BodyPart  messageBodyPart = new MimeBodyPart();
    messageBodyPart.setDataHandler(new DataHandler(source));
    multipart.addBodyPart(messageBodyPart);
    // send message.
    message.setContent(multipart);
    transport.sendMessage(message, message.getAllRecipients());

  • Weblogic 6.0 (SP2) generates incorrect java code for JSP with response.sendRedirect()

              Hi,
              Here are the steps to reproduce the problem with the examplesWebApp application
              bundled with wlserver6.0(sp2):
              Product: Weblogic server 6.0 (sp2)
              Browser: IE 5.0
              1. Add index.jsp as the welcome file in WEB-INF/web.xml
              2. Create index.jsp as below:
              <%
              response.sendRedirect("index.html");
              return;
              %>
              <html>
              <head>
              <title>Index JSP file</title>
              </head>
              <body>
              <font color="red">This is index.jsp file </font>
              </body>
              </html>
              3. Create index.html as below:
              <html>
              <head>
              <title>Index HTML file</title>
              </head>
              <body>
              <font color="red">This is index.html file </font>
              </body>
              </html>
              4. Run the examples server and make sure examplesWebApp is deployed on the examples
              server using the console
              5. Access the URL http://localhost:7001/examplesWebApp
              The page will display a compilation error as below:
              C:\bea\wlserver6.0\config\examples\applications\examplesWebApp\WEB-INF\_tmp_war_examplesServer_examplesServer_examplesWebApp\jsp_servlet\_index.java:89:
              unreachable statement
              out.print("\r\n<html>\r\n<head>\r\n<title>Simple html</title>\r\n</head>\r\n<body>\r\n<font
              color=\"red\">This is index.jsp page</font>\r\n</body>\r\n</html>\r\n");
              ^
              and a look at the generated java code for index.jsp (_index.java) will reveal
              the erroneous code snippet below in the jsp service method:
              try { // error page try block
              //[ /index.jsp; Line: 1]
              response.sendRedirect("index.html"); //[ /index.jsp; Line: 2]
              return; //[ /index.jsp; Line: 3]
              out.print("\r\n<html>\r\n<head>\r\n<title>Simple html</title>\r\n</head>\r\n<body>\r\n<font
              color=\"red\">This is index.jsp page</font>\r\n</body>\r\n</html>\r\n");
              } catch (Exception __ee) {
              while (out != null && out != _originalOut) out = pageContext.popBody();
              pageContext.handlePageException(__ee);
              The above web application works fine in Tomcat 3.2.X environment. The Weblogic
              server 6.0 servlet engine should not generate the "out.println()" corresponding
              to the html section of index.jsp. The moment it sees the "return", it should stop
              processing further.
              Can someone from Weblogic support team please verify this and let me know when
              this bug will be fixed?
              One interesting thing I noticed was when we last tried weblogic 6.0 at its beta
              stage, it worked fine after we put in a special patch jar file called "redirectfix.jar"
              we received from weblogic team but somehow it got re-introduced by the time it
              was released!!
              We are planning to migrate our product from tomcat 3.2.x to weblogic 6.0. Our
              product has a lot of pages with such conditional {response.sendRdirect("page.jsp");return;}
              blocks. We would really appreciate a faster response form weblogic team.
              Thanks in advance.
              sam...
              Sam Palanisamy
              Senior Software Engineer
              Manage.com
              2345 N. First Street First Floor
              San Jose CA 95131
              

    Why should it stop when it sees a return? Is that in the spec?
              Peace,
              Cameron Purdy
              Tangosol Inc.
              << Tangosol Server: How Weblogic applications are customized >>
              << Download now from http://www.tangosol.com/download.jsp >>
              "Sam Palanisamy" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi,
              >
              > Here are the steps to reproduce the problem with the examplesWebApp
              application
              > bundled with wlserver6.0(sp2):
              >
              > Product: Weblogic server 6.0 (sp2)
              > Browser: IE 5.0
              >
              > 1. Add index.jsp as the welcome file in WEB-INF/web.xml
              >
              > 2. Create index.jsp as below:
              > <%
              > response.sendRedirect("index.html");
              > return;
              > %>
              > <html>
              > <head>
              > <title>Index JSP file</title>
              > </head>
              > <body>
              > <font color="red">This is index.jsp file </font>
              > </body>
              > </html>
              >
              > 3. Create index.html as below:
              > <html>
              > <head>
              > <title>Index HTML file</title>
              > </head>
              > <body>
              > <font color="red">This is index.html file </font>
              > </body>
              > </html>
              >
              > 4. Run the examples server and make sure examplesWebApp is deployed on the
              examples
              > server using the console
              >
              > 5. Access the URL http://localhost:7001/examplesWebApp
              >
              > The page will display a compilation error as below:
              >
              C:\bea\wlserver6.0\config\examples\applications\examplesWebApp\WEB-INF\_tmp_
              war_examplesServer_examplesServer_examplesWebApp\jsp_servlet\_index.java:89:
              > unreachable statement
              > out.print("\r\n<html>\r\n<head>\r\n<title>Simple
              html</title>\r\n</head>\r\n<body>\r\n<font
              > color=\"red\">This is index.jsp page</font>\r\n</body>\r\n</html>\r\n");
              > ^
              >
              > and a look at the generated java code for index.jsp (_index.java) will
              reveal
              > the erroneous code snippet below in the jsp service method:
              >
              > try { // error page try block
              >
              > //[ /index.jsp; Line: 1]
              > response.sendRedirect("index.html"); //[ /index.jsp; Line: 2]
              > return; //[ /index.jsp; Line: 3]
              > out.print("\r\n<html>\r\n<head>\r\n<title>Simple
              html</title>\r\n</head>\r\n<body>\r\n<font
              > color=\"red\">This is index.jsp page</font>\r\n</body>\r\n</html>\r\n");
              > } catch (Exception __ee) {
              > while (out != null && out != _originalOut) out =
              pageContext.popBody();
              > pageContext.handlePageException(__ee);
              > }
              >
              > The above web application works fine in Tomcat 3.2.X environment. The
              Weblogic
              > server 6.0 servlet engine should not generate the "out.println()"
              corresponding
              > to the html section of index.jsp. The moment it sees the "return", it
              should stop
              > processing further.
              >
              > Can someone from Weblogic support team please verify this and let me know
              when
              > this bug will be fixed?
              >
              > One interesting thing I noticed was when we last tried weblogic 6.0 at its
              beta
              > stage, it worked fine after we put in a special patch jar file called
              "redirectfix.jar"
              > we received from weblogic team but somehow it got re-introduced by the
              time it
              > was released!!
              >
              > We are planning to migrate our product from tomcat 3.2.x to weblogic 6.0.
              Our
              > product has a lot of pages with such conditional
              {response.sendRdirect("page.jsp");return;}
              > blocks. We would really appreciate a faster response form weblogic team.
              >
              > Thanks in advance.
              > sam...
              > Sam Palanisamy
              > Senior Software Engineer
              > Manage.com
              > 2345 N. First Street First Floor
              > San Jose CA 95131
              >
              >
              

Maybe you are looking for

  • Photoshop CS3 Extended Crash on exit

    Problem with AdobeOwl.dll according to debug report. Also Variations not working. I can send jpg of crash report if you like.

  • Unable to mount XSAN volume on client workstation

    We just reimaged one of our machines and we are now unable to mount the xsan volume. Originally when the machine hooked up the IP was wrong and the XSAN couldn't see it. This has been fixed and the XSAN sees it now and it is authenticated, but when w

  • Header Condition for Purchase Order Services

    Hi All, It´s possible to add a header/item condition at service level, that will be charged in total  at  the first service entry sheet for that service? Thanks in advance, Tiago Ferreira

  • Save an image file in my phone/ memory-card memory.

    Hi everyone, I want to save a file (an image file) in my phone/ memory-card memory. i've infact captured it from camera and now want to save in the memory not in the RecordStore. What should i do ? Please help me. Thanks in advance

  • Table name where actual price of P.O. item has been stored

    Hello Exparts,        I want P.O. item amount which having Net Price, all taxes of taht P.O. item as well as deliverable cost and any other deduction in the net price. i.e. actual price which is paid but with P.O. item combination. Can any one tell m