Help on JSP Basic

Hi ALL ,
Can any one help me on Basic JSP.
Question:
I have a jsp page called page.jsp and 123.jsp.. in 123.jsp i have a Hyper link Called HLINK if user click that link ... contents in the page.jsp as to be displayed in the 123.jsp page just below the Hlink.. it is possible or what ... if possible any help over this..
Thanks in advance
Regards
Vicky

Hi,
Thanks for your reply..
Could u pl . tell me how to set that Hlink target to the frame...
Regards
Vicky

Similar Messages

  • How to get context sensitive help  in JSP Pages

    Is it possible to display context sensitive help in JSP Pages when I press the tab key on the keyboard base on the key focus. I don�t want to use any applet or Swing components, because it�s a web page viewed on the browser
    Thanks

    Java code inside a JSP is interpreted on the server and the HTML produced by the server it is shown in the client browser. The JSP code can incorporate calls to the JavaHelp API if it is available to the server. Those calls can be used on the server side to map parts of the JSP to contents of a help set (HTML pages).
    Given that, you can provide context sensitive help, but when it comes to view help information, you either can show HTML only (without TOC, index, etc.) or you'd need an applet.
    Ulrich

  • Need help w/ JSP formating a page.

    Ok. I need to make the following code work. I think it needs help w/ formating is all. Below is the JSP page I would like it in as well as where I think the code should go. Not shure how to get it to display the output though.
    var fullSessionName;
    Function startHODSession(sessionName) {
    var i = document.HODApplet.startSession(sessionName);
    if (i == 0) {
    fullSessionName = sessionName + document.HODApplet.getSessionID();
    I need to run that part of code and display the output on a webpage. Any help would be awosme as I am lost w/ JSP more of a vb kind of guy. but learning quickly. Thanks for any help or advice.
    Thanks
    My JSP file:
    <%--
    Document : index
    Created on : Oct 7, 2008, 7:14:58 AM
    Author : tl01mjf
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@page import ="java.applet.Applet" %>
    <%@page import = "ibm.eNetwork.HOD.BaseApplet" %>
    <%@page import = "ibm.eNetwork.HOD.HostOnDemand" %>
    <%@page import = "ibm.eNetwork.HOD.JSHostOnDemand" %>
    <%
    CODE GOES HERE
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <h2>Hello World!</h2>
    <input type="text" name="AgentID" value="" />
    <input type="submit" value="Push IT" name="id"/>
    </body>
    </html>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Great catch on the aplet and maybe that is where I am going wrong. So let me back up a little and maybe you can get me out of my bind.
    Basically what I want for a test app is: a little text box w/ a button. type in an number and click the button.
    the button will then send the info to a terminal emulator. (ibm host on demand)
    So that is what the 3 include statements where for. I got that from the API example.
    so what I really need the page to do is print the list of connections.
    so I need to get the latest session ID:
    var fullSessionName;
    Function startHODSession(sessionName) {
    var i = document.HODApplet.startSession(sessionName);
    if (i == 0) {
    fullSessionName = sessionName + document.HODApplet.getSessionID();
    Then run:
    public int sendKeys1 (String text)
    The string being what was put in the box.
    for right now i do not need error checking and i know the screen will be on the right spot to accpet the input.
    so if there is a better way to make it work using an applet....Im all for it.
    any ideas would be great.
    thanks

  • Need serious help with JSP + JDBC/Database connection

    Hey all,
    I have to build an assignment using JSP pages. I am still pretty new and only learning through trial and error. I understand a bit now, and I have managed to get a bit done for it.
    I am having the most trouble with a Login Screen. The requirements are that the a form in a webpage has Username/Number and Password, the user clicks Login, and thats about it. The values for the username/number and password NEED to come from the database and I cannot manage to do this. The thing I have done is basically hardcode the values into the SQL statement in the .jsp file. This works, but only for that one user.
    I need it so it checks the username/number and password entered by the user, checks the database to see if they are in it, and if so, give access. I seriously am stuck and have no idea on what to do.
    I dont even know if I have made these JSP pages correct for starters, I can send them out if someone is willing to look/help.
    I have setup 3 other forms required for the assignment and they are reading data from the db and displaying within tables, I need to do this with non-hardcoded values aswell. Im pretty sure I need to use for example 'SELECT .... FROM .... WHERE username= +usrnm' (a variable instead of username="john" , this is hardcoded), I just CANNOT figure out how to go about it.
    Its hard to explain through here so I hope I gave enough info. A friend of mine gave some psuedocode i should use to make it, it seems ok to follow, its just I do not know enough to do it. He suggested:
    get the username and pass from the env vars
    open the db
    make an sql (eg SELECT user, pass FROM users WHERE user = envuser)
    index.jsp points to login.jsp
    login.jsp get the vars you put into index.jsp
    opened the db
    is the query returns nothing - then the user is wrong
    OR if the passwords dont match
    - redirect back to index.jsp
    if it does match
    - set up a session
    - redirect to mainmenu.jsp
    Anyway, thanks for any help you can give.
    -Aaron

    Hi,
    Try this... it may help you...
    mainMenu.jsp
    <html>
    <body>
    <form method="POST" action="login.jsp">
    Username: <input type="text" name="cust_no">
    <p>
    Password: <input type="password" name="password">
    <p>
    <input type="submit" value="LOGIN">
    </form>
    </body>
    </html>
    login.jsp
    <%@ page import="java.io.*, java.sql.*"%>
    <html>
    <body>
    <%
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection connection = DriverManager.getConnection("jdbc:odbc:rocky");
    Statement statement = connection.createStatement();
    String query = "SELECT cust_no, password FROM customers WHERE cust_no='";
    query += request.getParameter("cust_no") + "' AND password='";
    query += request.getParameter("password") + "';";
    ResultSet resSum = statement.executeQuery(query);
    if (request.getParameter("cust_no").equalsIgnoreCase(resSum.getString("cust_no") && request.getParameter("password").equalsIgnoreCase(resSum.getString("password"))
    %>
    <h2>You are logged in!</h2>
    <%
    else
    %>
    <h2>You better check your username and password!</h2>
    <%
    }catch (ClassNotFoundException cnfe){
    System.err.println(cnfe);
    }catch (SQLException ex ){
    System.err.println( ex);
    }catch (Exception er){
    er.printStackTrace();
    %>
    </body>
    </html>
    I didn't check the code that I wrote. So you may have to fix some part of it. Also this may not be the best solution, but it will help you to understand the process easily.
    The more efficient method is to check whether the result set returned from the database is null or not.... I hope you got the idea... Good luck!
    Rajesh

  • JSP basic questions ( i think )

    Hi, I'm new to JSP.
    I established a database connection using JSP. However, I would prefer a java connection, so I have a program called JDBCBean.java which attempts the connection. However, when I compile this and place it in my classes folder, then try to use it in my jsp file, I get a "class not found" error. This confuses me, since it IS there and I set the classpath to the folder in which it is located....
    The JDBC has : package oracle.jdbc at the top
    and in my JSP file I have, for use bean, class = "oracle.jdbc.JDBCBean".
    I can't figure out what causes my error, or how to fix it, so any help would be greatly appreciated.
    Another thing I can' quite figure is the arguements stuff. Now I can pass parameters using a form...
    For example, I tested with textbox "please enter a name". You enter a name, it then uses that parameter in the URL e.g. www.something.com/something.jsp?name=bob
    But... what I want to do is have some sort of setup where, you have, say 3 types.
    e.g. Type - 1 2 3
    And if you click on 1, the parameter would be an SQL query. e.g. Select * from x where type = '1';
    and then the page displays the results of my query.
    Is this so hard? For the life of me, I can't find such info in my book and I've hunted the net and found nothing useful. All i find is about ASP, which I think is a good bit different.
    Please help. Sample code or links or whatever would be great.
    Thanks a lot.

    Ok, classpath is irrelevant? Understood.
    This is the bean stuff i took from my book. I assume package and the class i have are correct.
    Going by these, JDBCBean.class should be located in /oracle/jdbc/ yes??
    JDBCBean.java
    package oracle.jdbc;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class JDBCBean implements Serializable{
      protected transient String tableName, url;
      protected transient String query, columnNames;
      protected transient String resultTable, condn;
      protected transient String userid, password;
      protected transient Connection conn;
      public JDBCBean(){
        tableName = null;
        resultTable = null;
        condn = null;
        columnNames = null;
        resultTable = null;
        query = null;
        conn = null;
        userid = null;
        password = null;
      public void setTableName(String tableName){
        this.tableName = tableName;
      public String getTableName(){
        return tableName;
      public void setURL(String url){
        this.url = url;
      public String getURL(){
        return url;
      public void setCondn(String condn){
        this.condn = null;
        this.condn = condn;
      public String getCondn(){
        return condn;
      public void setUserid(String userid){
        this.userid = userid;
      public String getUserid(){
        return userid;
      public void setPassword(String password){
        this.password = password;
      public String getPassword(){
        return password;
      public void setColumnNames(String columnNames){
        this.columnNames = columnNames;
      public String getColumnNames(){
        return columnNames;
      public void setResultTable(String resultTable){
        this.resultTable = resultTable;
      public String getResultTable(){
        this.readTable();
        return resultTable;
      public void readTable(){
        int i = 0;
        String condition = "";
        if(columnNames == null){
          columnNames = "*";
        if(condn == null){
          condition = "";
        else{
          condition = " WHERE " + condn;
        query = "SELECT ";
            if (columnNames.charAt(0) == '*') {
              query += "* FROM " + tableName;
            } else {
            query += columnNames + " FROM " + tableName;
        if((!condition.equals(""))){
          query += condition;
        executeQuery(query);
      private void executeQuery(String query){
        if(conn == null){
          initialize();
        try{
          Statement stmt = conn.createStatement();
          ResultSet rset = stmt.executeQuery(query);
          ResultSetMetaData rsmd = rset.getMetaData();
          StringBuffer returnBuffer = new StringBuffer();
                int colNum = rsmd.getColumnCount();
                returnBuffer.append("\n\n<TABLE BORDER=\"1\" " +
                  "CELLSPACING=\"0\" CELLPADDING=\"3\">\n\t<TR>\n");
              for (int i=1; i <= colNum; i++){
                  returnBuffer.append("\t\t<TD>");
                  returnBuffer.append("<B>" +
                    rsmd.getColumnName(i) + "</B></TD>\n");
              returnBuffer.append("\t</TR>\n");
              while (rset.next()){
                returnBuffer.append("\t<TR>\n");
                for (int i=1; i <= colNum; i++)
                  returnBuffer.append("\t\t<TD>" +
                  rset.getString(i) + "</TD>\n");
                  returnBuffer.append("\t</TR>\n");
                returnBuffer.append("</TABLE>");
           resultTable = returnBuffer.toString();
           stmt.close();
           done();
        }catch(SQLException se){se.printStackTrace();}
      private void initialize(){
        try{
          Class.forName("oracle.jdbc.driver.OracleDriver");
          conn =
            DriverManager.getConnection(url, userid, password);
        }catch(SQLException se){se.printStackTrace();}
         catch(ClassNotFoundException cnfe)
                     {cnfe.printStackTrace();}
      public void done(){
        if(conn != null){
          try{
            conn.close();
          }catch(SQLException se){se.printStackTrace();}
    }JDBCBean.jsp
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Final//EN">
    <HTML>
    <BODY BGCOLOR="white">
    <% // Condn and ColumnNames are optional. Default ='*' %>
    <jsp:useBean class="oracle.jdbc.JDBCBean"
           scope="page"
           id="example" >
       <jsp:setProperty name="example"
           property="URL"
           value="jdbc:oracle:thin:@mysite:myport:xxx" />
       <jsp:setProperty name="example"
           property="Userid"
           value="me" />
       <jsp:setProperty name="example"
           property="Password"
           value="mypassword" />
       <jsp:setProperty name="example"
           property="TableName"
           value="system_users" />
       <jsp:setProperty name="example"
           property="ColumnNames"
           value="*" />
       <jsp:setProperty name="example"
           property="Condn"
           value="first_name != 'Bill'" />
       <jsp:getProperty name="example"
           property="ResultTable" />
    </jsp:useBean>
    </BODY>
    </HTML>I haven't really modified the code yet, as I want to establish a working java connection first.
    By the second part, what I meant was :
    You have something like "select a type" and then you have the options - 1, 2 , 3.
    If you choose 1, I want it to execute a query which will then display everything of type 1 on the page. e.g. pass the parameter (select * from table where type = '1';)
    Basically, your page would then be "refreshed" displaying the data your query produces, using another bean I presume.
    Thanks!

  • Help with jsp and servlets(litterature)

    I'm planning on converting a asp website to jsp and I need to figure out the following:
    1: servlet that gives out connection objects from a pool and manages "lost" connections to a mysql db
    2: a bean that has getConnection and closeConnection that is used on every jsp page.
    3: servlet/bean that can check size/dimesions/filetype on a remote url image
    4: Figure out what users are logged in at every given moment. result: x users are on, these are user1, user2, user3. automatic removal when session runs out. probably need a servlet for this.
    I got these books:
    deitel java how to program 3rd edition
    deitel advanced java 2 platform how to program
    The last book has a servlet and jsp section ut I suspect that java has evolved since then so thats why I'm asking if you have any other suggestions that offer more than 2 chapters. Its really basic the stuff i have :)
    Its been 3 years since I've touched java so i hope you guys can recomend jsp/servlet books that can answer these questions for me and help me get started with this project?
    Thanks :)

    1. apache dbcp commons library.
    http://jakarta.apache.org/commons/dbcp/
    2. tomcat DataSource, which already has the dbpc logic incorporated into it.
    http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
    3. no idea, google may help
    4. HttpSessionBindingListener. This allows you to monitor when a bean (such as a User bean) is added to the session and when it is removed from the session. This way you can track yourself which users are online.
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSessionBindingListener.html

  • Help with JSP/Weblogic/Tomcat Discrepencies

    Hi,
              I have something very strange happening. I recently did some JSP stuff on
              WLS60SP1 and all went quite well. I then took those same JSP pages and tried
              them out on the latest release of TOMCAT. I was really impressed that
              everything seemed to be completely transparent and working just fine until
              the following situation:
              When I reference, within a JSP page, an object that has previously been
              added to the request scope that has just been created, but not messed with
              in anyway...meaning all the attributes in this bean have their default
              values set...and they are all Strings with the exception of one Integer
              using this format:
              <%= custVal.getCustomerNumber() %>
              - In WLS, what shows in the text field on the form is nothing, because
              customer number in the custVal object is null (default for a String)..this
              is what I want.
              - In Tomcat, what shows it the word "null".
              ...here is the weird part, by changing from scriptlet references to the
              <jsp:getProperty....> format such as....
              <jsp:getProperty name="custVal" property="customerNumber"/>
              -In WLS, he is still a happy camper and works just fine regardless of how I
              reference the bean
              -In Tomcat, I also get the correct results that I want.
              So, unlike most postings, I found out how to fix it but I would like to know
              why...any ideas?
              Thanks in advance,
              Paul Reed
              www.jacksonreed.com
              object training and mentoring
              Jackson-Reed, Inc. 888-598-8615
              www.jacksonreed.com
              Author of "Developing Applications with Visual Basic and UML"
              http://www.amazon.com/exec/obidos/ASIN/0201615797/jackreedinc/104-0083168-31
              95939
              Author of "Developing Applications with Java
              

              Try http://localhost:7001/HelloWorld.jsp
              "b. patel" <[email protected]> wrote:
              >
              >I need help with running a simple JSP. I created a WLS domain using the
              >WebLogic
              >Configuration Wizard. I am trying to access HelloWorld.jsp which is
              >located under
              >C:\bea\user_projects\wlsdomainex\applications\DefaultWebApp.
              >I type
              >http://localhost:7001/DefaultWebApp/HelloWorld.jsp. I get 404 - Page
              >Not Found
              >Error. The weblogic server starts Succesfully. I am trying this in Win
              >2K environment.
              >
              >I am new to WebLogic. Thanks for your Help in advance.
              >
              

  • Help with jsp page

    I have a servlet which passes details to a jsp page, i am having trouble picking up what is passed in the jsp page can somebody help me with this?
    this is the lines from the servlet which should pass the data:
    request.setAttribute("notvalid", "whatShouldIputHere");
                   RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/mypage.jsp");
                   dispatcher.forward(request, response);          This is the jsp page i have tried to make:
    <body>
         <jsp:usebean id="notvalid"
              class ="site.validator2"
              Scope="request"     />
         <h1>message: </h1>
         <jsp:getProperty name="notvalid" property="notvalid" />
    </body>
    </html>

    The fundamental problem is that the OP is asking questions about Servlet and JSP development without fully understanding the basics of containers and the rendezvous method of data sharing, life-cycle, data scope, and the like.
    It is better that (s)he read up on the basics.

  • Help with JSP and LUCENE -

    I downloaded Lucene (apache product) and put the jar files in the /webapps/lucene/WEB-INF/lib directory. I created a simple jsp file:
    test.jsp
    <%@ page import = "org.apache.lucene.*" %>
    <%@ page import = "java.io.*" %>
    <%@ page import = "java.util.Date" %>
    Test
    <%
    Date start = new Date();
    IndexWriter writer = new IndexWriter("index", new StandardAnalyzer(), true);
    %>
    Started <%=start %>
    When pulling it up I get:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred between lines: 7 and 12 in the jsp file: /test.jsp
    Generated servlet error:
    /home/tpleasan/cots/jakarta/jakarta-tomcat-4.0.6/work/Standalone/localhost/lucene/test$jsp.java:73: Class org.apache.jsp.IndexWriter not found.
    IndexWriter writer = new IndexWriter("index", new StandardAnalyzer(), true);
    ^
    An error occurred between lines: 7 and 12 in the jsp file: /test.jsp
    Generated servlet error:
    /home/tpleasan/cots/jakarta/jakarta-tomcat-4.0.6/work/Standalone/localhost/lucene/test$jsp.java:73: Class org.apache.jsp.IndexWriter not found.
    IndexWriter writer = new IndexWriter("index", new StandardAnalyzer(), true);
    ^
    2 errors
    I don't know what is wrong. The classpath I thought was set correctly to my jar files, but that doesn't seem to work. There isn't much documention on how to use JSP with Lucene. I got the basic examples they have working, but can't seem to get it working when I create my own stuff.
    PLEASE HELP!!!!!!!!!!!!!!!!!

    Apparently I have to set the classpath EACH TIME.
    How can I program this into the jsp so I don't have to do that? I thought that it would automatically find it if it was in the correct directory.
    Also I am following the directions of lucene but it won't search correctly. Nothing gets returned in the example search. What gives???

  • Help on jsp code to display data in same page using using ajax ?

    Is there any jsp code to display in same page using using ajax ?

    Re: need help on how to display data in same jsp page. Locking.

  • Need help with JSP - Session Bean scenario

    I have massive problems with a simple JSP <--> Statefull Session Bean scenario with Server Platform Edition 8.2 (build b06-fcs)
    What I do is generating a Collection in session bean returning it to JSP
    and giving the List back to Session Bean.
    A weird exception happens when giving the List back to Session Bean
    (see Exception details below)
    The same code runs without any trouble on Jboss Application Server 4.0.3
    Any help would be great!
    Please see code below
    Statefull Session Bean
    <code>
    package ejb;
    import data.Produkt;
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.Iterator;
    import javax.ejb.*;
    * This is the bean class for the WarenkorbBean enterprise bean.
    * Created 17.03.2006 09:53:25
    * @author Administrator
    public class WarenkorbBean implements SessionBean, WarenkorbRemoteBusiness, WarenkorbLocalBusiness {
    private SessionContext context;
    // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click the + sign on the left to edit the code.">
    // TODO Add code to acquire and use other enterprise resources (DataSource, JMS, enterprise bean, Web services)
    // TODO Add business methods or web service operations
    * @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
    public void setSessionContext(SessionContext aContext) {
    context = aContext;
    * @see javax.ejb.SessionBean#ejbActivate()
    public void ejbActivate() {
    * @see javax.ejb.SessionBean#ejbPassivate()
    public void ejbPassivate() {
    * @see javax.ejb.SessionBean#ejbRemove()
    public void ejbRemove() {
    // </editor-fold>
    * See section 7.10.3 of the EJB 2.0 specification
    * See section 7.11.3 of the EJB 2.1 specification
    public void ejbCreate() {
    // TODO implement ejbCreate if necessary, acquire resources
    // This method has access to the JNDI context so resource aquisition
    // spanning all methods can be performed here such as home interfaces
    // and data sources.
    // Add business logic below. (Right-click in editor and choose
    // "EJB Methods > Add Business Method" or "Web Service > Add Operation")
    public Collection erzeugeWarenkorb() {
    //TODO implement erzeugeWarenkorb
    ArrayList myList = new ArrayList();
    for (int i=0;i<10;i++)
    Produkt prod = new Produkt();
    prod.setID(i);
    prod.setName("Produkt"+i);
    myList.add(prod);
    return myList;
    public void leseWarenkorb(Collection Liste) {
    //TODO implement leseWarenkorb
    Iterator listIt = Liste.iterator();
    while(listIt.hasNext())
    Produkt p = (Produkt)listIt.next();
    System.out.println("Name des Produktes {0} "+p.getName());
    </code>
    <code>
    package data;
    import java.io.Serializable;
    * @author Administrator
    public class Produkt implements Serializable {
    private int ID;
    private String Name;
    /** Creates a new instance of Produkt */
    public Produkt() {
    public int getID() {
    return ID;
    public void setID(int ID) {
    this.ID = ID;
    public String getName() {
    return Name;
    public void setName(String Name) {
    this.Name = Name;
    </code>
    <code>
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="java.util.*"%>
    <%@page import="data.*"%>
    <%@page import="javax.naming.*"%>
    <%@page import="javax.rmi.PortableRemoteObject"%>
    <%@page import="ejb.*"%>
    <%--
    The taglib directive below imports the JSTL library. If you uncomment it,
    you must also add the JSTL library to the project. The Add Library... action
    on Libraries node in Projects view can be used to add the JSTL 1.1 library.
    --%>
    <%--
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    --%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <h1>Online Shop Warenkorb Test</h1>
    <%--
    This example uses JSTL, uncomment the taglib directive above.
    To test, display the page like this: index.jsp?sayHello=true&name=Murphy
    --%>
    <%--
    <c:if test="${param.sayHello}">
    <!-- Let's welcome the user ${param.name} -->
    Hello ${param.name}!
    </c:if>
    --%>
    <%
    Context myEnv = null;
    WarenkorbRemote wr = null;
    // Context initialisation
    try
    myEnv = (Context)new javax.naming.InitialContext();
    /*Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
    //env.put(Context.PROVIDER_URL, "jnp://wotan.activenet.at:1099");
    env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
    env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
    myEnv = new InitialContext(env);*/
    catch (Exception ex)
    System.err.println("Fehler beim initialisieren des Context: " + ex.getMessage());
    // now lets work
    try
    Object ref = myEnv.lookup("ejb/WarenkorbBean");
    //Object ref = myEnv.lookup("WarenkorbBean");
    WarenkorbRemoteHome warenkorbrhome = (WarenkorbRemoteHome)
    PortableRemoteObject.narrow(ref, WarenkorbRemoteHome.class);
    wr = warenkorbrhome.create();
    ArrayList myList = (ArrayList)wr.erzeugeWarenkorb();
    Iterator it = myList.iterator();
    while(it.hasNext())
    Produkt p = (Produkt)it.next();
    %>
    ProduktID: <%=p.getID()%><br></br>Produktbezeichnung:
    <%=p.getName()%><br></br><%
    wr.leseWarenkorb(myList);
    catch(Exception ex)
    %><p style="color:red">Onlineshop nicht erreichbar</p><%=ex.getMessage()%>
    <% }
    %>
    </body>
    </html>
    </code>
    the exception
    CORBA MARSHAL 1398079745 Maybe; nested exception is: org.omg.CORBA.MARSHAL: ----------BEGIN server-side stack trace---------- org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:8101) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:873) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:863) at com.sun.corba.ee.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java:275) at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectDelegate(IIOPInputStream.java:363) at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectOverride(IIOPInputStream.java:526) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:333) at java.util.ArrayList.readObject(ArrayList.java:591) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.corba.ee.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1694) at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1212) at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:330) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:296) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034) at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259) at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.read(DynamicMethodMarshallerImpl.java:333) at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readArguments(DynamicMethodMarshallerImpl.java:393) at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121) at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:648) at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:192) at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1709) at com.sun.corba.ee.impl.protocol.SharedCDRClientRequestDispatcherImpl.marshalingComplete(SharedCDRClientRequestDispatcherImpl.java:155) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:184) at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129) at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:150) at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source) at ejb._WarenkorbRemote_DynamicStub.leseWarenkorb(_WarenkorbRemote_DynamicStub.java) at org.apache.jsp.index_jsp._jspService(index_jsp.java:122) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105) at javax.servlet.http.HttpServlet.service(HttpServlet.java:860) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247) at javax.servlet.http.HttpServlet.service(HttpServlet.java:860) at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257) at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189) at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604) at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475) at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371) at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281) at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83) Caused by: java.lang.ClassNotFoundException ... 69 more ----------END server-side stack trace---------- vmcid: SUN minor code: 257 completed: Maybe

    Hi,
    I have found a way out by passing the reference of my EJB in the HttpSession object and using it inside the javabean..

  • Any help appreciated jsp...

    hi
    ive got a problem regarding jsp.... for starters i cant even view the jsp examples on the tomcat index page....
    the servlet examples run fine and i can create my own servlets as well..
    but when i try to create my own simple jsp page or run the examples i get the following error...
    "......The server encountered an internal error () that prevented it from fulfilling this request.
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null....blah blah ..."
    ive got a feeling this is a set up related error ... im running xp
    with j2sdk1.4.2 and tomcat 4.1
    any help would be appreciated as i have to get jsp up and running pretty soon .....
    thanks
    mark

    Hi cram81,
    It sounds strange that jsp examples are not working from a default install. I can only guess that your classpath is setup wrong.
    Another possibility is that the .jar files in CATALINA_HOME/common/lib are not the correct ones for compiling the jsp files.
    Tomcat will always look in the above folder when attempting to compile jsp files.
    Servlet examples work because they are precompiled, where-as the server always compiles jsp's at runtime if it's the first time that you are running that jsp or a change has been made to it.
    Usually the jsp examples fail to compile because of a classpath error.
    Check it out and let me know how you get on.

  • Help on JSP Function

    Hi,
    I am writing follow. java function inside my JSP
    <jsp:useBean
         id="inquiryBean" class = "com.bbh.actionworld.pagingcontrol.inquiry.Inquiry" scope = "session">
    </jsp:useBean>
    <%
         int sIndex = inquiryBean.getStartIndex();
         int eIndex = inquiryBean.getEndIndex();
         int pSize = inquiryBean.getPageSize();
         out.println("sIndex= " + sIndex + "eIndex = " + eIndex + "pSize = " + pSize);
    %>
    <%!
    void getNextRecords() {
    if (sIndex == 0)
    if ((sIndex > 0) && (sIndex < dataArray.length))
    sIndex = eIndex;
    eIndex = sIndex + pSize;
    out.println("after next sIndex = " + sIndex + "eIndex = " + eIndex + "pSize = " + pSize);
    inquiryBean.setStartIndex(sIndex);
    inquiryBean.setEndIndex(eIndex);
    %>
    I'm getting errors like sIndex, eIndex , pSize ,out , inquiryBean are undefined variables in function.
    Can anybody help me ?
    Thanx in advance.
    -Priya

    do the three variables have local scope.
    i.e have you declared them within a block and are trying
    to use outside that block , if so they no longer exist in
    memory.
    just a guess.

  • URGENT help with JSP

    Any help with this will be really appreciated. I'm new to programming.
    If I search for an ssn in a database, I want to view all records relating to that ssn. However, I am getting all the records in the table.
    eg.
    at the prompt for ssn, let's say I enter 111111111
    I would like to see
    111111111 abc xyz etc
    111111111 pdg ppp etc
    however, I am getting
    000000000 utt tui etc
    111111111 tug etg etc
    How do I make limit the search to the ssn I want?
    The related code is below.
    Thanks.
    Java Code
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    if (checkLoginSessionPresent(request, response)) {
    loadTable("/esoladm/TaxView.jsp", request, response);
    else {
    checkLoginSessionRedirect("/esoladm/ESOLAdminMain.jsp", request, response);
    JSP Code
    <% while (MyTaxSuppress != null) { %>             
    <% String sPlanCode = MyTaxSuppress.getPlanCode(); %>
    <% String sSSN = MyTaxSuppress.getSSN(); %>
    <% String sTaxYear = MyTaxSuppress.getTaxYear(); %>
    <% String sDistCode = MyTaxSuppress.getDistCode(); %>
    <% double sGrAmount = MyTaxSuppress.getGrAmount(); %>
    <% String sStmtType = MyTaxSuppress.getStmtType(); %>
    <% boolean bNewSuppress = MyTaxSuppress.getNewSuppress(); %>
    <% String rowID = sPlanCode; %>
    <% rowID += sSSN; %>
    <% rowID += sTaxYear; %>
    <% rowID += sDistCode; %>
    <% rowID += sStmtType; %>
    <% rowID += sGrAmount; %>
    <% System.out.println( "Do While lp exiti" + rowID);%
    <% if (bNewSuppress) { %>
    <% out.println( "<TD> %>
    <% <img BORDER='0' SRC='/esoladm/ESOLNew2.gif' %>
    <% ALT='' WIDTH='50' HEIGHT='20'> </TD >"); %>
    <% } else { %>
    <% out.println( "<TD></TD>"); %>
    <% } %>
    <TD><%= sPlanCode %></TD>
    <TD><%= sSSN %></TD>
    <TD><%= sTaxYear %></TD>
    <TD><%= sDistCode %></TD>
    <TD><%= sGrAmount %></TD>
    <TD><%= sStmyType %></TD>
    <TD><input TYPE="checkbox" name="<%=rowID %>" ></TD>
    <% MyTaxSuppress = MySuppressTaxList.getNext(); %>
    <% } // end of while loop %>

    I don't see anywhere in your code where you conditionally output a tuple from your database. You seem to be outputting everything.
    Maybe you need:
    <% if (sSSN==input_value){ %>
    <TD><input TYPE="checkbox" name="<%=rowID %>" ></TD>
    <% } %>

  • For each help in JSP ?

    Hi all
    Does JSP support for each statement ??
    Actually i need to cycle through each post variable like this in ASP
    for each tempvarname in request.form
    value1 = request.form(tempvarname)
    pass=pass&value1
    next
    I am unable to do this JSP...
    Can somebody help ?

    Use JSTL's c:forEach tag.
    <c:forEach items="${param}" var="item">
        ${item.key} = ${item.value}<br/>
    </c:forEach>That said, the need for this is a smell. Rethink your approach.

Maybe you are looking for