Also VERY frustrated:  No java-code executing within JSP

Hi!
I'm completely frustrated at last! It must be possible to install tomcat/apache correct but I'm not able to do so!
New problem:
I try to view a jsp with IE6 by selecting File\Open. If I choose the copy at '\tomcat\webapps\examples\WEB-INF\jspjbex4.jsp' suddenly Dreamweaver opens and show me the code of 'jbex4.jsp'. When I open a copy of jbex4.jsp located anywhere else on my computer the jsp is shown, but the problem is: No javabean-code is used although it is coded correctly.
I guess the problem is with some classpath or something quite simillar. When I try to view the examples delivered by tomcat I've got the same problem: Whereever there should be output generated by java-code (e.g. by calling a method like <%= test.getDM() %>) there's nothing!!!!!
So I checked if apache is working correctly. The test page is shown correctly. So the error must occure somewhere under tomcat. But when starting tomcat I receive no error message..
Can anyone please help me?
Thanx a lot!!!!!
p.s. Yes, 'Normal' java-code is executed fine!

With tomcat 1.3.3 you place the xml file with the context mapping in the conf folder under the tomcat install directory. You must give the xml file a name that starts with "apps-" followed by something unique, followed by ".xml". So for examle apps-testapp.xml is good. Inside the xml file place the code I gave you above then restart tomcat. Make sure to change the docBase value to the directory that contains your WEB_INF folder and change the path to whatever you want. If the path is set to "/" then you would use the url http://www.yourdomain.com/yourjsp.jsp. If the path is set to "/TestApp" then you use the URL http://www.yourdomain.com/TestApp/yourjsp.jsp.
For newer version of tomcat I am not sure exactly where the context mapping goes. Instead of in an apps-xyz.xml file it might go in tomcats server.xml file which should also be in the conf directory in the tomcat install directory.
Each webapp has its own config file which should be at /WEB-INF/web.xml. Look on google or something about that. All your classes go in /WEB-INF/classes/package.name/class.class.
Put your class files into packages!
for you you should put your bean at /WEB-INF/classes/testpackage/JspTest.class.
In the code for JspTest.java place "package testpackage;" at the top then recompile. In your JSP file use <jsp:useBean id="ex4" scope="session" class="testpackage.JspTest" />
-S-

Similar Messages

  • JNI - Java code executed before native code

    Hi there, I'm having a problem, I've got this native thing working but it seems like my java code is being executed before the native one. Example :
    class Hello
    { static { System.loadLibrary("D1"); }
    public native void displayHello();
    public static void main(String[] args)
    new Hello().displayHello();
    System.out.println("kfdhgkfldh");
    The output is:
    "kfdhgkfldh"
    "Message from JNI"
    So the printfunction from the main has been executed before the one in my C++ program
    Any idea why ??
    (this is quite important)
    thx

    Tryfflush(stdin);before returning from the native function

  • How to put HTML content after the following java code in the JSP

    Hello Guys :),
    In the following jsp I force the user to download a file but I am not able to perform any action after I do this. I want to put some HTML code in this jsp at the end so that user has the option of doing other things after downloading the file.
    Any solution will be highly appreciated :)
    Thanks
    <%@ page import="java.util.*,java.io.*"%>
    <script language="JavaScript" src="common.js"></script>
    <%
    Hashtable hashTable = (Hashtable)session.getAttribute("platformAndSampleInfo");
    Date date = (Date)hashTable.get("date");
    String userName = (String)hashTable.get("userName");
    String dateString = date.toString().substring(0, date.toString().length()-9).replace(' ','_');
    dateString = dateString.replace(':','_');
    String fileExtension = (String)session.getAttribute("fileExtension"); //,getFileExtension(request));
    String outputFile = userName + dateString + fileExtension;
         File f = new File (outputFile);
         response.setContentType("APPLICATION/OCTET-STREAM");
         response.setHeader ("Content-Disposition", "attachment; filename=\""+ f.getName() + "\"");
    InputStream in = new FileInputStream(f);
         ServletOutputStream outs = response.getOutputStream();
              int bit = 256;
              int i = 0;
              try {
                   while ((bit) >= 0) {
                        bit = in.read();
                        outs.write(bit);
              } catch (IOException ioe) {
                   ioe.printStackTrace(System.out);
              outs.flush();
              outs.close();
              in.close();     
    %>
    <!--
    The following piece of HTML code is never reached
    -->
    <html>
    Want to display this
    <html>

    Thats odd.. try using out to print the character
    inst of creating the instance outs.. Maybe your
    overiding something.
    ex)
    char c='s';
    out.print(c);
    //the jsp will create the instance of out for you.

  • How to redirect in java code not the jsp or any other

    hello
    can any one help me how to redirect in java pages the code must be in java function not in jsp or any thing else
    thanks in advance

    Function? Don't you rather mean method?
    Anyway, in JSF you can send a redirect using ExternalContext#redirect(). If your JSF environment is on top of JSP/Servlet, then under the hood it basically invokes HttpServletResponse#sendRedirect() and FacesContext#responseComplete().

  • Very inexperienced Sun Java coder , Help !!!! I  get NullPointerException

    In Sun JKD1.5.0
    programs
    CalculatorInterface.java
    Client.java ==> c[4]
    Account.java ==> a[3]
    CalculatorInterface ==> c[4] objects ==> a[3] objects
    I have in CalculatorInterface.java
    public class CalculatorInterface
    // reference to class Client
    private static final int maxClients = 4;
    // constructor for client[] object array
    private static client[] c = new client[maxClients];
    private static int total,atotal;
    private static int noClients;
    etc
    etc
    public static void main (String[] args)
    parameter definitions
    code lines
    c[noClients] = new client();
    / creates a new instance of client contained in c[]
    total = noClients;
    code lines
    method calls
    noClients++; // next c[]
    termination
    } // end of Main
    CalculatorInterface Methods including
    void WhatIsLeft()
    ... code ...
    ....code...
    c[total].getAccount(atotal).setAmount_IS_Surplus(c[total].calcWeeklySurplus(salaryYrly,weeklyExpenses,isRes));
    ... code...
    The line of code returns a NullPointerException and crashes the program !!! >_<
    is not successfully calling methods in Account.java ..... ?????
    === === === === === === > AND : I have in Client.java
    public class client
    // references to object Account a[]
    private static final int maxAccounts = 3;
    private Account[] a = new Account[maxAccounts]; //? This references a[] to client
    Client Methods including
    public Account getAccount(int num)
    return a[num]; // will be num = 0 or 1 or 2
    } // end client
    === === ==== ===> AND in Account.java
    public class Account
    Account methods
    SO ..... what's the fix ?
    HELP !!!!! I know not what to do to fix this glitch.

    And now I take the chance to ask someone...
    Where is that forum to discuss about the
    forums?
    deleted
    Damn! <sarcasm> I love you Sun. </sarcasm>

  • Running Java applications from within JSP

    Hi Folks,
    First of all, apologies if this post is either 1) in the wrong forum or 2) a horrendous mis-application of java/JSP :D
    I have a java test harness application that I have created, it runs from the command line, taking two arguments (the name of the app you want to test and the location of the properties file) and it then looks up the app in the properties file and tests the application - writing results to html reports and errors to logs... all pretty standard so far.
    The apps i normally test are usually on an app server (normally IBMs WAS), so I thought, why dont I create a Web Application with a nice JSP page listing all the applications that can be tested(extracted from the properties file) and allow the user to go to the jsp and just click the "test this service" button or "view results" button for any service - just to make it more manageable.
    So I have created the JSP page with the list of applications, and the links to all the result.html files - so now I just need to implement the functionality to be able to hit the link "Test now" and the test harness runs in the background.
    Does anyone please have any ideas?
    The best i came up with was creating a link to a new jsp page that had the code on it to create the main Test Harness object and then calling the execute() method - however, when i press the link i get taken to the page but my tests arent run? (this test was run on Tomcat if that makes any difference)
    Any ideas? of any better ways to approach the task?
    Thanks in advance guys!!

    Start with Java EE tutorial part II: [http://java.sun.com/javaee/5/docs/tutorial/doc/bnadp.html].
    To create a Servlet you basically just extend HttpServlet and implement the appropriate methods, such as doGet() for GET requests and doPost() for POST requests. To run it, you need to define it in the web.xml and map it on an appropriate url-pattern with which you want to invoke the servlet by URL.
    To fullfill your requirement, I think implementing doGet() ought to be sufficient. E.g.
    yourpackage.YourServlet.javaprotected void doGet(HttpServletRequest request, HttpServletResponse response) {
        YourJavaClass yourJavaClass = new YourJavaClass();
        Object someResult = yourJavaClass.doSomething();
        request.setAttribute("someResult", someResult);
        request.getRequestDispatcher("yourPage.jsp").forward(request, response);
    }yourPage.jsp<p>Result: ${someResult}</p>web.xml<servlet>
        <servlet-name>yourServlet</servlet-name>
        <servlet-class>yourpackage.YourServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>yourServlet</servlet-name>
        <url-pattern>/yourServlet</url-pattern>
    </servlet-mapping>Invoke it by [http://localhost:8080/yourContext/yourServlet].

  • Java Mail Problems within JSP Page

    Hi all,
    I'm encountering the following problem. I hava a jsp file named common.jsp with holds all common functions like write header and footer and also a send mail function. i include this page in all my other jsp pages. In the signup page - i need to send out 2 emails, one to the administrator and the other to the user who signed up. so i call that send mail function twice. the first call works(meaning it sends out the email) but the second call gives me a No SMTP Provider exception. Can anyone help me with this.
    thx a bunch
    p.s: i have included the sendEmail Function below
    public void sendEmail(String emailServer, String sEmail, String sName, String rEmail,
         String subject, String strmsg) throws Exception {
         java.util.Properties props = new java.util.Properties();
         props.put("mail.host", emailServer);
         javax.mail.Session mailConn = javax.mail.Session.getInstance(props, null);
         javax.mail.Message msg = new javax.mail.internet.MimeMessage(mailConn);
         javax.mail.Address sender = new javax.mail.internet.InternetAddress(sEmail, sName);
         javax.mail.Address receiver = new javax.mail.internet.InternetAddress(rEmail);
         msg.setContent(strmsg,"text/html");
         msg.setFrom(sender);
         msg.setRecipient(javax.mail.Message.RecipientType.TO, receiver);
         msg.setSubject(subject);
         javax.mail.Transport.send(msg);
    }

    This is what i use and it works just fine
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class sendMail {
    public sendMail(String To,String Subject,String message) {
    String to = To, subject = Subject, from = null,
              cc = null, bcc = null, url = null;
         String protocol = null, host = null, user = null, password = null;
         boolean debug = false;
         try{
    Properties props = System.getProperties();
         Session session = Session.getDefaultInstance(props, null);
         Message msg = new MimeMessage(session);
         if (debug)
              session.setDebug(true);
    msg.setFrom(new InternetAddress("[email protected]"));
         msg.setRecipients(Message.RecipientType.TO,
                             InternetAddress.parse(to, false));
         msg.setSubject(subject);
    msg.setText(message);
         msg.setHeader("Mail","test.com");
         msg.setSentDate(new Date());
         Transport.send(msg);
         System.out.println("\nMail was sent successfully.");
         } catch (Exception e) {
         e.printStackTrace();

  • Java Code to be executed on Oracle Service Bus startup

    Hello
    I have a problem that i would hope to find some help on the best practices given my specific requirements.
    I need to have a piece of java code executed on every startup of my OSB server. This piece of code's function is part of an OSB project, and I need the Jar to be in a folder inside that project.
    I'm avoiding creating an external project so I don't have to give support and write documentation to two projects instead of one.
    Can somebody help me please?
    Best Regards
    Hélder Ribeiro

    I dont't have visibility on your requirements and the technical details. They way you've described doesn't seem to be the best way to implement it.
    But if you want to do this anyway, you can use weblogic startup class to invoke a webservice exposed by your osb project, which will invoke a java method in a class inside the jar under your osb poject.
    In the class which will be invoked by the weblogic startup class, you will have to retrieve the managed server host and port.
    Regards,
    Fabio Douek.

  • 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 Textbox strings in Java code

    Hi,
    I wonder if anyone can help me with a problem I'm
    having with a JSP.
    I've got several text boxes on my JSP which are static and would like to access their contents from within some dynamic Java code contained within the same JSP. I.e If I have a text box whose name is my_text I
    would like to use my_text as a string within my Java code.
    Does anyone know how to do this?
    Thanks,
    Peter

    actually u can user java variable values in a html form/javacript but not vice versa.

  • 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.
    %

  • How can we call java control source methods within jsp

    Hi guys!
              How can we access java control source methods that are defined in java control projects within jsp.I am getting error when I tried to call java control source's methods in scriptlet of JSP page.Any help/suggestion is appreciated.
              Thanks
              -Chandu

    Uh, what?
    (And you are sure that it's not a Weblogic-specific question?)

  • 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
              >
              >
              

  • HELP NEED FOR INVOKING THE JAVA CODE INSIDE JSP

    Hello,
    any one knows how to Write a java code inside the .jsp files... please if any one knows it please ....help me .....

    hi .
    Use scriptlets , for example :
    <html>
    <%
    int x;
    for(x=1;x<=5;x++)
    out.println(x);
    %>
    </html>

  • 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

Maybe you are looking for

  • HT204387 I have an iPhone 3GS and I can't get it to pair with my iPad 3rd Gen neither will discover the other any suggestions

    I have an iPhone 3GS and I can't get it to pair with my iPad 3rd Gen neither will discover the other any suggestions

  • Block settlement to auc for downpayment

    Hi SAP Friends, There is a specific requirement in one of our project. In an investment project, advance payment is issued against a service PO with ref to WBS. The requirement is to block the settlement to AUC for this advance payment only until ser

  • FCE 4 Automatic Color Corrections

    I imported some old VHS tapes (originally on 16 MM video camera, converted to VHS) via my ADVC-300. I am new to MAC and FCE so forgive my basic question, searches did not result in any hits. Anyone have suggestions on cleaning up the video? Can the f

  • Remote User IP Address Function Problem

    I am using the APEX listener for weblogic with Apache in front. When I use owa_util.get_cgi_env ('REMOTE_ADDR'), I am not receiving the IP of the remote user but instead I am getting the application server IP. Does anyone have any ideas on how I can

  • Zen Xtra Stopped transferr

    I upgraded to the new Play for Sure Firmware, and had all the same 'teething Problems' everyone else had with regard to speed etc, but at least it worked with Napster. Now, 24 songs transfered without any problems, it suddenly won't let me transfer o