Add .js to JSP

I have tried including as .js file to the JSP page something like this:
<% String url = componentRequest.getWebResourcePath() + "/scripts/my.js";%>
and if i use something like this:
<script language="JavaScript" src="<%=url%>"></script>
to call a function in that .js file iam getting error.
<a href = "javascript:fun()">Have Fun</a>
fun is a simple alert function in my.js file.
What is wrong with this??
Regards!

Thought itz a big , but itz working fine after restarting the portal.
Regards.

Similar Messages

  • How to add entries a jsp file during a Source view

    hi all,
    im currently extending the tags present on BEA. im creating my own custom tag. when i tried to drag and drop it on the current source view of the jsp file..
    is it possible for me to check the current source code of the jsp file first before preceding. For example. if the tag to be inserted must be within a certain tag only..
    or modify an existing tag. say a <netui:form > and add some attributes on it.

    Looks like Crystal Reports is using log4j for logging, which is so badly designed that it throws a fit if the log4j configuration is missing.
    All you need to do to get it to work is put a log4j.properties file in the classpath (google for a dummy file with default values). It usually needs to be put in the root of the classpath.
    Or you can initialize the log4j logging for your own application properly and Crystal Reports will piggyback on it.

  • How do I add an included jsp to my project and not get a compile error?

    Hi,
    I have a project with some included jsp's however if I add them to the project, when I build I get a compile error as the jsp uses variables from the calling jsp.
    Any ideas on how to get round this.
    Thanks
    DM

    There are two main ways that I deal with this problem (yeah, it sucks, but it sort of makes sense that it happens...) (I presume you're talking static include here...)
    #1 - name the included file with an extension that JDev will not try to compile (.jspf - for JSP Fragment - is common) Then it will be compiled in with the including page, but won't gag the project compilation. Advantage - it works, and you find out at compile time if you hosed up the variable reference. Disadvantage: JDev tries really, really, really hard to keep you from naming a JSP file with an extension of .jspf I normally create the .jsp file in JDev, remove it from the project, rename the file outside of JDeveloper, then add it back to the project - pain in the butt, but it works (and you probably aren't building scads of these included files...)
    #2 - add the variable to be referenced to the pageContext implicit object as an attribute in your including page (ex, <% pageContext.setAttribute("myVar", myVar); %>), then reference that attribute in your included JSP (ex, <%= pageContext.getAttribute("myVar") %>) . It will compile fine (as the compiler has no way of knowing if the pageContext attribute actually exists, it just sees that the syntax is good and motors along merrily. Advantage: don't have to have differently named JSP files (which isn't actually a big deal). Disadvantage: You hvae to add the variable to the pageContext (and you have to always add Object derivatives, as primitives won't go into a hash) and you don't find out if you screwed the variable up until runtime (when it tries the getAttribute, which could return null if you didn't properly set it to start with) vs at compile-time w/ the direct reference.
    HTH!
    Jim

  • In .java add elements to .jsp

    Hello!
    I'm just beginning and can't understand one thing:
    When I create JSPDynPage, system create JSP and JAVA file - it's clear. Then I add elements to form in JSP, for example, Layout.
    Can I add, for example, row into that Layout in .java file?
        .JSP:
    <hbj:form>
             <hbj:formLayout
                 id="myLayout"
                 width="100%">
                 <hbj:formLayoutRow
                         id="Row1">
                         <hbj:formLayoutCell
                                 id="Cell11"
                                 align="LEFT"
                                 width="100%">                
                                 <hbj:textView
                                     id="welcome_message"
                                     text="May the force be with you unknown user"
                                     design="HEADER1" />
                           </hbj:formLayoutCell>
                   </hbj:formLayoutRow>                      
               </hbj:formLayout>            
        </hbj:form>
    .JAVA:
    public void doProcessBeforeOutput() throws PageException {
             this.setJspName("myjsp.jsp");
          Form Reg_Form = null;
          FormLayout RF_All  = new FormLayout();
          Tray Left_Tray1 = new Tray("TrayRules1");
           Reg_Form = (Form)this.getForm();
           RF_All = (FormLayout) this.getComponentByName("myLayout");
           for (int i = 1; i <= 3; i++ ) {     RF_All.addRow(); }
           Left_Tray1.setTitle("Sample Title");
           Left_Tray1.setWidth("100%");
           TextView Left_Tray1_text = new TextView("Left_Tray1_text");
           Left_Tray1_text.setText("Sample Text");
           Left_Tray1_text.setEncode(false);
           Left_Tray1_text.setWrapping(true);
           Left_Tray1.addComponent(Left_Tray1_text);
           RF_All.addComponent(2,1, Left_Tray1);
           Reg_Form.addComponent(RF_All);
    That code don't display Tray in page...

    Paul,
    I suggest you  not to add the your business logic in that auto generated file.
    Instead you can have seperate java file or any Bean.
    Since you are writing the logic for layout you can add the code in the jsp file
    itself.
    If you are using HTMLB Then keep the auto generated code in the jsp otherwise remove the code and keep the file as jsp meaning you use the html, javascript,
    jsp code in the .jsp file itself.
    you can add the java code in the jsp
    <% String strName = "SAP"; %>
    <sc ript>
    al ert("<%=strName%>");
    </sc ript>
    Ram

  • How to add tables in JSP page dynamically?

    Hi all,
    I am Girish, i am new to Java. I want to create a html page.
    The main requirment in the page is ...
    Initialy the page will contains a table which will accepts some data.
    If the user want to enter some more information he can click one add button such that a new table will be created. If he wants to delete created table he can select delete button such that the table will be deleted in the same JSP page.
    Please give me a solution.. how to achieve this requirment.
    Waiting for reply..
    Thanks in advance...
    Regards,
    Girish.K

    this is a sample.. you can give it a try:
    whatever jsp
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@page import="java.util.*,mypackage.TestBean"%>
    <%
    String name = request.getParameter("name")!=null?request.getParameter("name"):"";
    String age = request.getParameter("age")!=null?request.getParameter("age"):"";
    System.out.println(name);
    System.out.println(age);
    Collection col = new ArrayList();
    col = (Collection)session.getAttribute("col")!=null?(Collection)session.getAttribute("col"):new ArrayList();
    TestBean tBean = new TestBean();
    if(!name.equals(""))
      tBean.setName(name);
    if(!age.equals(""))
      tBean.setAge(age);
    if(!age.equals("") || !name.equals(""))
      col.add(tBean);
    session.setAttribute("col",col);
    %>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
        <title>untitled</title>
      </head>
      <body>
        <form>
          <table cellspacing="0" cellpadding="0" border="1" width="200">
            <tr>
              <td>Name</td>
              <td>
                <input type="text" name="name"/>
              </td>
            </tr>
            <tr>
              <td>Age</td>
              <td>
                <input type="text" name="age"/>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <input type="submit" value="Submit"/>
              </td>
            </tr>
          </table>
          <%
          if(col.size()>0){
          Iterator iter = col.iterator();
          %>
          <table cellspacing="0" cellpadding="0" border="1" width="200">
            <tr>
              <td>
                NAME
              </td>
              <td>
                AGE
              </td>
             </tr>
            <%while(iter.hasNext()){
              tBean = (TestBean)iter.next();
            %>
              <tr>
                <td>
                  <%=tBean.getName()%>
                </td>
                <td>
                  <%=tBean.getAge()%>
                </td>
               </tr>
            <%}%>
          </table>
          <%}%>
        </form>
      </body>
    </html>TestBean.java
    package mypackage;
    public class TestBean
      private String name;
      private String age;
      public TestBean()
      public String getName()
        return name;
      public void setName(String name)
        this.name = name;
      public String getAge()
        return age;
      public void setAge(String age)
        this.age = age;
    }

  • JSP is not getting displayed in add portlet repositery

    Hi,
    I have registered two servlet in provider.xml and I was able to
    view that servlet as a portlet in add portlet repositery.
    After that I wanted to add one more JSP as portlet under same
    provider. So I have kept JSP in same directory where servlet is
    kept. I have added JSP as portlet in Provider(i.e. provider.xml)
    and given appPath and appRoot for that JSP. Whenever I am trying
    to view my provider by giving following URL
    http://servername/servlet/myprovider
    I am getting message -
    Congratulations! You have successfully reached your Provider's
    Test Page.
    in same page I am able to view my all portlets. in that list I
    am able to view my JSP as a portlet.
    Now I want to add JSP portlet in my page at that time that JSP
    portlet is not getting displayed in add portlet repositery.
    Can anybody tell why JSP is not getting displayed in portlet
    repositery ? What should I do to get it displayed in portlet
    repositery ?
    Thanks in advance.
    Biren

    You have to refresh the Provider. They are a couple of ways to
    do it.
    1. Take a look at the release notes for PDK-Java.
    http://portalstudio.oracle.com/servlet/page?_pageid=468&_dad=ops&
    _schema=OPSTUDIO
    It mentions and auto reload feature that will refresh the
    provider on the PDK-Java side when you make changes to the
    provider.xml. When you add portlet, you simply refresh the
    repository in portal and add the new portlet to a page.
    2. If you do not have the auto_reload parameter, you simply need
    to refresh manually.
    a. After updating the provider.xml, restart the HttpServer where
    your PDK-Java Provider is located.
    b. Refresh the Portlet Repository
    Both these do the same thing, and should solve your problem
    Sue

  • Unable to add Custom JSP 1.2 Tag Library to Project

    I am trying to upgrade to a newer version of JDeveloper (10.1.3.0.4) but am having a problem with projects that use custom JSP tag libraries.
    After converting the project (.jpr) files to the new version, I double click and go to "JSP Tag Libraries." When I click on "Add" to add a new JSP Tag library, only JSP version 1.1 libraries are shown, I cannot choose any JSP 1.2 tag libraries.
    my TLD files are all JSP 1.2, so I am not quite sure why this isn't working in a newer JDeveloper after it has worked fine in the past. If I examine any JSP page that uses my taglibs, I see the following 2 kinds of error:
    the line:
    <%@ taglib uri="taglib.uri" prefix="mytag" %>
    is underlined in red and says "the tag library taglib.uri is referenced, but not installed"
    And for any lines that try to use the custom tag:
    <mytag:dosomething>
    there is a yellow/orange underline that says "no grammar available for namespace taglib.uri, contents of element dosomething cannot be validated"
    Note that I can add the taglib JAR file under Tools > Manage Libraries, but I cannot add the JSP tag library to my project. Is there some sort of compatibility issue when transferring project files from an old version of JDeveloper?
    Any help would be appreciated

    Yes any new project I create I can specify JSP 1.2 or 2.0 with the wizard and it works fine.
    But I don't want to re-create my entire project file again just to register my taglibs.
    Here's the JSP related section in web.xml:
    <!-- TagLibraries -->
    <taglib>
    <taglib-uri>taglib.uri</taglib-uri>
    <taglib-location>/WEB-INF/tlds/mytag.tld</taglib-location>
    </taglib>
    It's definately something in the project itself... but I am lost as to what it is.
    Edit: nvm I fixed it. It was the web.xml. I had to change the line:
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    into
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    and it worked. Thanks.
    Message was edited by:
    user523020

  • JSP PageType does not work in JDev 10.1.3 or 10.1.3.1

    Am attempting to create tags for use with JSP pages using the SimpleTagSupport class (am using JDev 10.1.3). Can create the desired class and it shows up in its tld file. However, when attempt to register the tag into the Component Pallet using the following directions, as per JDev Help,
    Adding Pages and JSP Tags to the Component Palette
    You can add pages to the Component Palette in JDeveloper to include the tags from a custom JSP tag library you created or one you have imported. You can create a new page for each tag library you want to include on the Palette; if the tag library is large, you may want to include several new pages on which to organize the additional tags.
    Tip: Follow the steps in Registering a Custom Tag Library in JDeveloper to register the library if you do not want to add the library and tags to the Palette.
    To add pages and JSP tags to the Component Palette:
    1.     Choose Tools Configure Palette to open the Configure Component Palette dialog.
    2.     Click Add under the Pages list to open the New Palette Page dialog.
    3.     Enter a Page Name and select JSP as the Page Type, then click OK.
    The only available Page Types are the following
    css
    java
    oxd_usc
    snippet
    JSP is NOT an available option?
    I am having the same issue with JDv 10.1.3.1. If I use JDev 10.1.2 - Adding Pages and JSP Tags to the Component Palette - there is no problem and the JSP Page Type does show up.
    How does the one create a JSP tag in JDev 10.1.3 using SimpleTagSupport?????
    Thanks - Ken

    Steff - the tutorial was really quite helpful - for a variety of reasons.
    However, even though it gave enough information to circumvent the JDev problem, it does not fix the problem of JDev in not being able to display JSP as a Page Type.
    Would really like to find out how to use the JSP Page Type which seems to be broken? I do not like telling a customer - well JDev has a problem with specifying a JSP Page Type and even though the Help says you can do it - you really cann't.
    Again - THANKS for the great reference - Casey

  • File problem using jsp

    I need help. I need to create a file browser for user to select the file in the explorer. How can i add one in jsp page? Also, how can i open and read the file?

    Caiyun,
    Look at the multipart request servlet example in oreilly.com or in any of the server packages./ Those examples do exactly what u want. Show a File box, read the contents and store it in the server.

  • How to create graphs on JSP page in JDeveloper 10.1.3

    Hi all,
    Is there an easy way to create graph objects with JDeveloper 10.1.3? I have taken a look to some tutorials, but it looks like they all use the "drag/drop graph from the data control palette" method.
    E.g. I got example 88 to work from http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html, but I have no idea how to get the BIGraphDef1.xml object and how to link it to a set of data.
    Are there some tutorials to show how graphs can be used in JDev 10.1.3?

    Frank,
    This is what I did to implement the graphic manual, but I think, I forgot something...
    1. create a new application with projects DataModel and UserInterface
    2. in the DataModel I created a similar master/detail view as the one of Steve, this is named:
    TestModuleDataControl
    \--DepView
    __\--Deptno
    __\--Dname
    __\--Loc
    __\--EmpView1
    ____\--Sal
    3. I created a new jspx page and added a graph tag:
    <f:verbatim>
    <graph:Graph data="${bindings.DepartmentsEmployeesInDepartmentGraph}"
    imageHeight="200" imageWidth="400"/>
    </f:verbatim>
    4. in the page definitions I added
    <graph id="DepartmentsEmployeesInDepartmentGraph"
    IterBinding="EmployeesInDepartmentIterator"
    ControlClass="oracle.dss.graph.Graph"
    SeriesLabel="Ename"
    GraphPropertiesFileName="userinterface.BIGrap1hDef1"
    SeriesType="SINGLE_SERIES">
    <AttrNames>
    <Item Value="Sal"/>
    </AttrNames>
    </graph>
    5. I added also the iterator:
    <iterator id="EmployeesInDepartmentIterator" Binds="EmpView1" RangeSize="10"
    DataControl="TestModuleDataControl"/>
    6. I copy/pasted the BIGraphDef1.xml from Steve's project into 'Application Sources'\userinterface.
    7. in the web.xml file in WEB-INF I added:
    <servlet>
    <servlet-name>GraphGeneratorServlet</servlet-name>
    <servlet-class>oracle.jbo.html.jsp.graph.GraphGeneratorServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>GraphGeneratorServlet</servlet-name>
    <url-pattern>/GraphGeneratorServlet</url-pattern>
    </servlet-mapping>
    8. when I run the page, I can't see the graph and there are also no errors. I think I mis a global setting somewhere...
    Is there anything I forgot to do?
    note: if I add a new jsp page into steve's application, I do can see the graph if I perform the steps mentioned above...
    I just found out that, If I create the graph on a page which is in the root directory, then it works. If I put it in a subdirectory, it doesn't:
    - create graph as mentioned above on a page: web content/myGraph.jspx --> works
    - create graph as mentioned above on a page: web content/app/myGraph.jspx --> doesn't work...
    Does somebody know where to put a setting/parameter to get the Graph visible in the subdirectory app?

  • How to download file in jsp

    Hi guys,
    I am a new member to this java community. I meet some problems in doing my project, hope you experts can help me.
    I want to add a download button in my jsp code. When users click the button, a file will be downloaded to his local computer. The files are ASCII files with .asc as extension. My server is Apache 1.3.19 with tomcat 3.2.1 . What kind of code should I add to my jsp?
    Anyone's quick response is greatly appreciated.

    Thanks for your reply.
    I have tried to use the hyper link in html. But since it's ASCII file with .asc extension, every time the link is clicked, the file is opened directly instead of offering save option. So maybe some special code is needed.
    Many software web site provides download page. When user clicks the download button, the file will be transfered to user's computer. Does anyone knows how to do it?
    Thanks.

  • Another JSP Fragment bug (or JSF flaw?)

    My application has a search box and go button in a JSPF fragment. But data content is rendered in a JSP. To demonstrate the problem I am going to slightly modify the Person/Trip tutorial sample:
    1. Create a new project
    2. Add Trip rowset to page1
    3. Set criteria perseonid = ?
    4. Add data table and bind it to trip rowset
    5. Add Integer PersonID property to the session bean
    6. Add PersonID initialization code:
    personID = new Integer(1);
    5. Add Page1 initialization:
    try {
    dataTable1Model.setObject(1, getSessionBean1().getPersonID());
    dataTable1Model.execute();
    } catch (Exception e) {
    throw new FacesException(e);
    5. Add a new JSP Fragment above the table and name it Test.jspf
    6. Place an edit field (Search) and a button to submit the search
    7. Add process value change event to the edit box:
    getSessionBean1().setPersonID(new Integer((String)vce.getNewValue()));
    8. Add action handler to the button but keep it empty for now since we do not have inter-page navigation here really
    Now start project and enter 2 into search field click on the button and see the table did not update. Enter 3 and see that the table now shows the records for the person id 2.
    So why do tutorial samples work and this JSPF does not? The problem is that JSPF fragment does not have any knowledge about the table data model on the Page1.jsp so it cannot synchronize it in the value change event!!! However, tutorial samples do update data model because value change event is in the same Java class. In this case JSPF is a completely different class.
    Now please tell me what am I supposed to do? Don't suggest me to access Page1.tableDataModel from the Test.jspf since my JSPF can be included in different pages.
    My current workaround again is using this call in the button action event:
    try { getExternalContext().redirect("Page1.jsp"); } catch (Exception e) {};
    Now, you have to pay me something for all that hard QA work I have to do for your entire QA department. ;-)
    Here is the codes: (just in case)
    Page1.java:
    * Page1.java
    * Created on December 19, 2004, 10:59 AM
    * Copyright ybaykshtis
    package test9;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import javax.faces.component.html.*;
    import com.sun.sql.rowset.*;
    import com.sun.jsfcl.data.*;
    import javax.faces.component.*;
    public class Page1 extends AbstractPageBean {
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
    private int __placeholder;
    private HtmlForm form1 = new HtmlForm();
    public HtmlForm getForm1() {
    return form1;
    public void setForm1(HtmlForm hf) {
    this.form1 = hf;
    private JdbcRowSetXImpl tripRowSet = new JdbcRowSetXImpl();
    public JdbcRowSetXImpl getTripRowSet() {
    return tripRowSet;
    public void setTripRowSet(JdbcRowSetXImpl jrsxi) {
    this.tripRowSet = jrsxi;
    private HtmlDataTable dataTable1 = new HtmlDataTable();
    public HtmlDataTable getDataTable1() {
    return dataTable1;
    public void setDataTable1(HtmlDataTable hdt) {
    this.dataTable1 = hdt;
    private UIColumn column1 = new UIColumn();
    public UIColumn getColumn1() {
    return column1;
    public void setColumn1(UIColumn uic) {
    this.column1 = uic;
    private HtmlOutputText outputText1 = new HtmlOutputText();
    public HtmlOutputText getOutputText1() {
    return outputText1;
    public void setOutputText1(HtmlOutputText hot) {
    this.outputText1 = hot;
    private HtmlOutputText outputText2 = new HtmlOutputText();
    public HtmlOutputText getOutputText2() {
    return outputText2;
    public void setOutputText2(HtmlOutputText hot) {
    this.outputText2 = hot;
    private UIColumn column2 = new UIColumn();
    public UIColumn getColumn2() {
    return column2;
    public void setColumn2(UIColumn uic) {
    this.column2 = uic;
    private HtmlOutputText outputText3 = new HtmlOutputText();
    public HtmlOutputText getOutputText3() {
    return outputText3;
    public void setOutputText3(HtmlOutputText hot) {
    this.outputText3 = hot;
    private HtmlOutputText outputText4 = new HtmlOutputText();
    public HtmlOutputText getOutputText4() {
    return outputText4;
    public void setOutputText4(HtmlOutputText hot) {
    this.outputText4 = hot;
    private UIColumn column3 = new UIColumn();
    public UIColumn getColumn3() {
    return column3;
    public void setColumn3(UIColumn uic) {
    this.column3 = uic;
    private HtmlOutputText outputText5 = new HtmlOutputText();
    public HtmlOutputText getOutputText5() {
    return outputText5;
    public void setOutputText5(HtmlOutputText hot) {
    this.outputText5 = hot;
    private HtmlOutputText outputText6 = new HtmlOutputText();
    public HtmlOutputText getOutputText6() {
    return outputText6;
    public void setOutputText6(HtmlOutputText hot) {
    this.outputText6 = hot;
    private UIColumn column4 = new UIColumn();
    public UIColumn getColumn4() {
    return column4;
    public void setColumn4(UIColumn uic) {
    this.column4 = uic;
    private HtmlOutputText outputText7 = new HtmlOutputText();
    public HtmlOutputText getOutputText7() {
    return outputText7;
    public void setOutputText7(HtmlOutputText hot) {
    this.outputText7 = hot;
    private HtmlOutputText outputText8 = new HtmlOutputText();
    public HtmlOutputText getOutputText8() {
    return outputText8;
    public void setOutputText8(HtmlOutputText hot) {
    this.outputText8 = hot;
    private UIColumn column5 = new UIColumn();
    public UIColumn getColumn5() {
    return column5;
    public void setColumn5(UIColumn uic) {
    this.column5 = uic;
    private HtmlOutputText outputText9 = new HtmlOutputText();
    public HtmlOutputText getOutputText9() {
    return outputText9;
    public void setOutputText9(HtmlOutputText hot) {
    this.outputText9 = hot;
    private HtmlOutputText outputText10 = new HtmlOutputText();
    public HtmlOutputText getOutputText10() {
    return outputText10;
    public void setOutputText10(HtmlOutputText hot) {
    this.outputText10 = hot;
    private UIColumn column6 = new UIColumn();
    public UIColumn getColumn6() {
    return column6;
    public void setColumn6(UIColumn uic) {
    this.column6 = uic;
    private HtmlOutputText outputText11 = new HtmlOutputText();
    public HtmlOutputText getOutputText11() {
    return outputText11;
    public void setOutputText11(HtmlOutputText hot) {
    this.outputText11 = hot;
    private HtmlOutputText outputText12 = new HtmlOutputText();
    public HtmlOutputText getOutputText12() {
    return outputText12;
    public void setOutputText12(HtmlOutputText hot) {
    this.outputText12 = hot;
    private RowSetDataModel dataTable1Model = new RowSetDataModel();
    public RowSetDataModel getDataTable1Model() {
    return dataTable1Model;
    public void setDataTable1Model(RowSetDataModel rsdm) {
    this.dataTable1Model = rsdm;
    // </editor-fold>
    public Page1() {
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
    try {
    tripRowSet.setDataSourceName("java:comp/env/jdbc/Travel");
    tripRowSet.setCommand("SELECT ALL TRAVEL.TRIP.TRIPID, TRAVEL.TRIP.PERSONID, TRAVEL.TRIP.DEPDATE, TRAVEL.TRIP.DEPCITY, TRAVEL.TRIP.DESTCITY, TRAVEL.TRIP.TRIPTYPEID FROM TRAVEL.TRIP WHERE TRAVEL.TRIP.PERSONID=?");
    dataTable1Model.setDataCacheKey("com.sun.datacache.Page1.tripRowSet");
    dataTable1Model.setRowSet(tripRowSet);
    dataTable1Model.setSchemaName("TRAVEL");
    dataTable1Model.setTableName("TRIP");
    } catch (Exception e) {
    log("Page1 Initialization Failure", e);
    throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
    // </editor-fold>
    // Additional user provided initialization code
    try {
    dataTable1Model.setObject(1, getSessionBean1().getPersonID());
    dataTable1Model.execute();
    } catch (Exception e) {
    throw new FacesException(e);
    protected test9.ApplicationBean1 getApplicationBean1() {
    return (test9.ApplicationBean1)getBean("ApplicationBean1");
    protected test9.SessionBean1 getSessionBean1() {
    return (test9.SessionBean1)getBean("SessionBean1");
    * Bean cleanup.
    protected void afterRenderResponse() {
    tripRowSet.close();
    Page1.jsp
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view><![CDATA[
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    ]]><html
    lang="en-US" xml:lang="en-US">
    <head>
    <meta content="no-cache" http-equiv="Cache-Control"/>
    <meta content="no-cache" http-equiv="Pragma"/>
    <title>Page1 Title</title>
    <link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
    </head>
    <body style="-rave-layout: grid">
    <h:form binding="#{Page1.form1}" id="form1">
    <h:dataTable binding="#{Page1.dataTable1}" headerClass="list-header" id="dataTable1" rowClasses="list-row-even,list-row-odd"
    style="left: 24px; top: 168px; position: absolute" value="#{Page1.dataTable1Model}" var="currentRow">
    <h:column binding="#{Page1.column1}" id="column1">
    <h:outputText binding="#{Page1.outputText1}" id="outputText1" value="#{currentRow['TRIPID']}"/>
    <f:facet name="header">
    <h:outputText binding="#{Page1.outputText2}" id="outputText2" value="TRIPID"/>
    </f:facet>
    </h:column>
    <h:column binding="#{Page1.column2}" id="column2">
    <h:outputText binding="#{Page1.outputText3}" id="outputText3" value="#{currentRow['PERSONID']}"/>
    <f:facet name="header">
    <h:outputText binding="#{Page1.outputText4}" id="outputText4" value="PERSONID"/>
    </f:facet>
    </h:column>
    <h:column binding="#{Page1.column3}" id="column3">
    <h:outputText binding="#{Page1.outputText5}" id="outputText5" value="#{currentRow['DEPDATE']}"/>
    <f:facet name="header">
    <h:outputText binding="#{Page1.outputText6}" id="outputText6" value="DEPDATE"/>
    </f:facet>
    </h:column>
    <h:column binding="#{Page1.column4}" id="column4">
    <h:outputText binding="#{Page1.outputText7}" id="outputText7" value="#{currentRow['DEPCITY']}"/>
    <f:facet name="header">
    <h:outputText binding="#{Page1.outputText8}" id="outputText8" value="DEPCITY"/>
    </f:facet>
    </h:column>
    <h:column binding="#{Page1.column5}" id="column5">
    <h:outputText binding="#{Page1.outputText9}" id="outputText9" value="#{currentRow['DESTCITY']}"/>
    <f:facet name="header">
    <h:outputText binding="#{Page1.outputText10}" id="outputText10" value="DESTCITY"/>
    </f:facet>
    </h:column>
    <h:column binding="#{Page1.column6}" id="column6">
    <h:outputText binding="#{Page1.outputText11}" id="outputText11" value="#{currentRow['TRIPTYPEID']}"/>
    <f:facet name="header">
    <h:outputText binding="#{Page1.outputText12}" id="outputText12" value="TRIPTYPEID"/>
    </f:facet>
    </h:column>
    </h:dataTable>
    <div style="left: 48px; top: 72px; position: absolute">
    <jsp:directive.include file="Test.jspf"/>
    </div>
    </h:form>
    </body>
    </html>
    </f:view>
    </jsp:root>
    Test.java
    * Test.java
    * Created on December 19, 2004, 11:01 AM
    * Copyright ybaykshtis
    package test9;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import javax.faces.component.html.*;
    import com.sun.jsfcl.data.*;
    import javax.faces.component.*;
    import com.sun.sql.rowset.*;
    import javax.faces.convert.*;
    import javax.faces.event.*;
    public class Test extends AbstractPageBean {
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
    private int __placeholder;
    private JdbcRowSetXImpl personRowSet = new JdbcRowSetXImpl();
    public JdbcRowSetXImpl getPersonRowSet() {
    return personRowSet;
    public void setPersonRowSet(JdbcRowSetXImpl jrsxi) {
    this.personRowSet = jrsxi;
    private HtmlInputText textField1 = new HtmlInputText();
    public HtmlInputText getTextField1() {
    return textField1;
    public void setTextField1(HtmlInputText hit) {
    this.textField1 = hit;
    private HtmlCommandButton button1 = new HtmlCommandButton();
    public HtmlCommandButton getButton1() {
    return button1;
    public void setButton1(HtmlCommandButton hcb) {
    this.button1 = hcb;
    // </editor-fold>
    public Test() {
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
    try {
    personRowSet.setDataSourceName("java:comp/env/jdbc/Travel");
    personRowSet.setCommand("SELECT * FROM TRAVEL.PERSON");
    } catch (Exception e) {
    log("Test Initialization Failure", e);
    throw e instanceof javax.faces.FacesException ? (FacesException) e: new FacesException(e);
    // </editor-fold>
    // Additional user provided initialization code
    protected test9.ApplicationBean1 getApplicationBean1() {
    return (test9.ApplicationBean1)getBean("ApplicationBean1");
    protected test9.SessionBean1 getSessionBean1() {
    return (test9.SessionBean1)getBean("SessionBean1");
    * Bean cleanup.
    protected void afterRenderResponse() {
    personRowSet.close();
    public String button1_action() {
    // User event code here...
    //try { getExternalContext().redirect("Page1.jsp"); } catch (Exception e) {};
    return null;
    public void textField1_processValueChange(ValueChangeEvent vce) {
    // User event code here...
    getSessionBean1().setPersonID(new Integer((String)vce.getNewValue()));
    Test.jspf
    <?xml version="1.0" encoding="UTF-8"?>
    <div style="-rave-layout: grid" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">
    <p>Included Content Here</p>
    <h:inputText binding="#{Test.textField1}" id="textField1" style="left: 48px; top: 48px; position: absolute" valueChangeListener="#{Test.textField1_processValueChange}"/>
    <h:commandButton action="#{Test.button1_action}" binding="#{Test.button1}" id="button1" style="left: 240px; top: 48px; position: absolute" value="Submit"/>
    </div>

    Hi ,
    Thanks for your valuable observations and feedback. I could observe that the workaround seems to be working fine. Thanks for providing the workaround.
    The problem you are facing without the workaround is a known issue and our engineers are currently working on it.
    Regards.
    Creator Team.

  • Oracle BPM 10gR3 JSP

    is there any plugin to view jsps in Oracle BPM studio 10.3.2. Thanks in advance.

    Go to Window-->Preferences-->General-->Editors-->File associations and in File Types click on Add and put *.jsp and in the next option add the editor you want, that can be an internal program or an external program.
    After that association when opening a jsp in the studio it will be opened with that editor.
    HTH

  • How can I get the workspace login name in a custom jsp?

    I want to add a custom jsp in workspace, how can I pass the login name to this jsp?

    DrClap wrote:
    I think the OP wants to start up an application like MS Word and then operate it from a Java program.Doesn't The Monkey's Paw do that? What a second, according to Wikipedia:
    [http://en.wikipedia.org/wiki/The_Monkey%27s_Paw]
    <quote>
    ...the paw of a dead monkey is a talisman that grants its possessor three wishes, but the wishes come with an enormous price.
    The moral of the story is contained in this description of the paw: "It had a spell put on it by an old fakir," said the sergeant-major, "a very holy man. He wanted to show that fate ruled people's lives, and that those who interfered with it did so to their sorrow."
    </quote>
    So I guess that a non-sequitor ... or is it?

  • Org.apache.jasper.JasperException: Unable to compile class for JSP

    Hi All,
    I have been using NetBeans IDE 3.5.1. AndI am trying to execute one JSP file, but it is giving error and i am not able to execute the servlet files also in NetBeans IDE. Can anybody help me out regarding this...
    type - Exception report
    message - Internal Server Error
    description - The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception -
    org.apache.jasper.JasperException: Unable to compile class for JSP
    C:\Documents and Settings\kiran\.netbeans\3.5\tomcat406_base\work\Tomcat-Internal\localhost\C_3A_5CDocuments+and+Settings_5Ckiran_5CNetBeans+IDE+3.5.1_5Ctomcat406_5Cwebapps_5Cctm\jsp1\AdminClient$jsp.java:5: Package login not found in import.
    import login.*;
    ^
    C:\Documents and Settings\kiran\.netbeans\3.5\tomcat406_base\work\Tomcat-Internal\localhost\C_3A_5CDocuments+and+Settings_5Ckiran_5CNetBeans+IDE+3.5.1_5Ctomcat406_5Cwebapps_5Cctm\jsp1\AdminClient$jsp.java:7: Package javax.ejb not found in import.
    import javax.ejb.*;
    ^
    2 errors
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
         at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.loadJSP(IDEJspServlet.java:442)
         at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.loadIfNecessary(IDEJspServlet.java:148)
         at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:160)
         at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
         at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:226)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:484)

    The page is located at web/test/test.jsp and the java as below
    Is there anything still need to add to test.jsp?
    DB.java (web/classes/DB/db.class)
    package DB;
    import java.sql.*;
    public class db
    String db_url="jdbc:mysql://localhost:3306/DB";
    String db_user="root";
    String db_password="123456";
    private ResultSet r=null;
    static private ResultSet res=null;
    int staff_Id=0;
    /** Creates a new instance of db */
    public int getRetrieveId()
    try{
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         catch (Exception E)
         E.printStackTrace();
         try{
    Connection C = DriverManager.getConnection(db_url,db_user,db_password);
    Statement S = C.createStatement();
    r = S.executeQuery("select max(staff_Id) from staff");
    while(r.next()){
    staff_Id=r.getInt(1);
    S.close();
    C.close();
    catch(Exception e)
    e.printStackTrace();
    return staff_Id;
    public static boolean getSearch(String s)
    String search_db_url="jdbc:mysql://localhost:3306/DB";
    String search_db_user="root";
    String search_db_password="123456";
    String str=null;
    boolean result=false;
    try{
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         catch (Exception E)
         E.printStackTrace();
         try{
    Connection C = DriverManager.getConnection(search_db_url,search_db_user,search_db_password);
    Statement S = C.createStatement();
    res = S.executeQuery(s);
    while(res.next()){
    str=res.getString(1);
    if(!str.equals(null))
    result=true;
    S.close();
    C.close();
    catch(Exception e)
    e.printStackTrace();
    return result;
    public void setUpdate(String str)
    try{
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         catch (Exception E)
         E.printStackTrace();
         try{
    Connection C = DriverManager.getConnection(db_url,db_user,db_password);
    Statement S = C.createStatement();
    int r = S.executeUpdate(str);
    S.close();
    C.close();
    catch(Exception e)
    e.printStackTrace();
    }

Maybe you are looking for