Newbie to JSP, Need to convert some ASP code to work for JSP

Can I get some aid in converting the following ASP code to work using JSP. I have never used JSP before but I now need to because of a recent server change.
<%
DIM URL
URL = LCase(Request.ServerVariables("URL"))
if InStr(URL, "/about/") then
%>
<p>About Test</p>
<% elseif InStr(URL, "/menu/") then %>
<p>Menu Test</p>
<% elseif InStr(URL, "/contact/") then %>
<p>Contact Test</p>
<% else %>
<p>Test</p>
<% End if %>Thanks in advance
Ned

Can I get some aid in converting the following ASP
code to work using JSP. I have never used JSP before
but I now need to because of a recent server change.
<%
DIM URL
URL = LCase(Request.ServerVariables("URL"))
if InStr(URL, "/about/") then
%>
<p>About Test</p>
<% elseif InStr(URL, "/menu/") then %>
<p>Menu Test</p>
<% elseif InStr(URL, "/contact/") then %>
<p>Contact Test</p>
<% else %>
<p>Test</p>
<% End if %>Thanks in advance
Ned<%
String sURL = request.getRequestURL();
if (sURL.indexOf("//about//") > 1) {
%>
<p>About Test</p>
<%
} else if (sURL.indexOf("//menu//") > 1) {
%>
<p>Menu Test</p>
<%
} else if ......
%>
I wont do the other cases. Im sure you can figure it out. Hope it helps!

Similar Messages

  • Need assistance converting some AS2 code to AS3

    Hi,
    I have some simple AS2 code that brings in a MovieClip when
    you click a button. This is currently AS2, and I would rather
    convert it to AS3. I also have some code which closes the MovieClip
    upon button Click.
    The code I am currently using is below:

    addMC is the name of one of the event handler functions, not
    the button(s). the button instance names are: addButton and
    removeButton.
    To have three of them, duplicate what you see and have new
    variables, functions, and button names for all three sets, adjusted
    appropriately.
    I'm pretty sure this isn't over yet, I'm just giving you code
    per your defined scenario, which may have a hole or two in it. Try
    it out and see what you really want to do, then come back when you
    find out things need to be tamed in some way or aren't working as
    you want. There are more complicated ways to deal with a situation
    depending on what you really want, and I'm one who prefers to see
    some work done at your end that shows you've tried something (I'm
    not mean, much, I just have this thing about learning by doing).

  • Need to convert 16X9 to 4:3 letterbox for DVD

    Hello
    Can anyone tell me the settings I need to convert 16X9 to 4:3 letterbox for DVD. I am mixing other 4:3 letterbox content. Evertime I make an mpeg with Quicktime conversion it is squeezed. I want it to be letterbox in 4:3
    Thanks in advance.
    I am using Final Cut Pro 4.5 and DVD pro 3
    Regards,
    Dana Gonzales

    In addition to using the advice above, make sure in Compressor (or other item you use to encode) that you are using the 16:9 encode ratio. If you are using QT conversion (which it sounds like from Final Cut?) also make sure that ratio is checked. Unlike a 4:3 m2v which will be 720 x 480 when you open it in QT, the 16:9 will be 720 x 404

  • Need help converting this html code into code that will work as a flash button

    I have some html code that is for a button in html that when
    pressed sends you to a certain url but also somehow adds an 'id
    value' and a 'website value'.
    How can I convert this code and or put it into a flash
    button?
    Disregard the gif info...that's just for the html graphic
    that goes for the button.
    [HTML]<form
    action="https://secure.verotel.com/cgi-bin/vtjp.pl"
    method="post">
    <input type=hidden name=verotel_id
    value="9804000000840231">
    <input type=hidden name=verotel_website value="55461">
    <center>
    <input type="image" src="
    http://buttons.verotel.com/join/button_00010155461.gif"
    alt="Signup NOW!">
    <img src="
    http://buttons.verotel.com/signup/tbutton_55461.gif"
    border="0" width="1" height="1" alt="">
    </center>
    </form>[/HTML]

    What you want to do might look something like this:

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

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

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

  • Need help with adjusting Javascript code to work in Adobe Edge (Countdown)

    Hello
    Im a newbie when it comes to working with Javascript and Adobe Edge and need a bit of help with adjusting some javascript code to work with Adobe Edge. A friend of mine helped me with making this javascript code: Edit fiddle - JSFiddle
    Its a simple countdown which counts down to a certain time at a certain date. What I aim to do is to add this code as a trigger on a text-element called "countdown" (within a symbol called "count").
    I have tried to do this as the code is, but it does not work. Anyone have any suggestions?
    Thanks!
    Mvh,
    Øyvind Hermans

    Hello again
    I have stumbled upon a problem with these animations; They crash the browser after viewing them a little while, usually less than 30 seconds in.
    Is this problem also occuring when you watch the animations?
    Is the countdown-code to much for the browsers to handle?
    Thanks in advance for your answers.
    Sincerely,
    Øyvind Hermans

  • Need help with some simple code

    Hi,
    I'm doing a lab for a class I'm taking and for the most part my code is working properly. It is supposed to accept inputs from the user of ints, doubles, or strings using the Scanner class until the user inputs "quit". It stores each input in array lists of class Integer, Double, and String. It the prints out each element of these in a list and quits the program. The problem is that after I query the user for input, if an int or double is input, the program then requires an input again before it will continue querying. So my question is how do I get it to query only once?
    The code and a copy of what it IS doing, and what it SHOULD do are shown below in bold.
    import java.util.ArrayList;
    import java.util.Scanner;
    import java.lang.Integer;
    import java.lang.Double;
    import java.lang.String;
    public class inputsort
    public static void main()
    int n = 0;
    boolean done = false;
    String quit;
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> intList = new ArrayList<Integer>();
    ArrayList<Double> doubList = new ArrayList<Double>();
    ArrayList<String> stringList = new ArrayList<String>();
    while(!done)
    System.out.print("Enter an int, double, any random text, or type quit to end: ");
    *if (sc.hasNextInt()){*
    intList.add(sc.nextInt());
    sc.next();
    *} else if (sc.hasNextDouble()){*
    doubList.add(sc.nextDouble());
    sc.next();
    *} else {*               
    quit = sc.next();
    *if (quit.equals("quit")) {*
    done = true;
    *else {*
    stringList.add(quit);
    System.out.println("Integers:");
    while(n < intList.size())
    System.out.print("Integer[" + n + "]: ");
    System.out.print(intList.get(n) + "\n");
    n += 1;
    n = 0;
    System.out.println("Doubles:");
    while(n < doubList.size())
    System.out.print("Double[" + n + "]: ");
    System.out.print(doubList.get(n) + "\n");
    n += 1;
    n = 0;
    System.out.println("Others:");
    while(n < stringList.size())
    System.out.print("Other[" + n + "]: ");
    System.out.print(stringList.get(n) + "\n");
    n += 1;
    Here's what it IS doing:
    Enter an int, double, any random text, or type quit to end: 10
    *10*
    Enter an int, double, any random text, or type quit to end: 1.2
    *1.2*
    Enter an int, double, any random text, or type quit to end: 3.4
    *3.4*
    Enter an int, double, any random text, or type quit to end: 5.6
    *5.6*
    Enter an int, double, any random text, or type quit to end: test
    Enter an int, double, any random text, or type quit to end: monkey
    Enter an int, double, any random text, or type quit to end: quit
    Integers:
    Integer[0]: 5
    Integer[1]: 10
    Doubles:
    Double[0]: 1.2
    Double[1]: 3.4
    Double[2]: 5.6
    Others:
    Other[0]: test
    Other[1]: monkey
    Here is what it SHOULD be doing:
    Enter an int, double, any random text, or type quit to end: 10
    Enter an int, double, any random text, or type quit to end: 1.2
    Enter an int, double, any random text, or type quit to end: 3.4
    Enter an int, double, any random text, or type quit to end: 5.6
    Enter an int, double, any random text, or type quit to end: test
    Enter an int, double, any random text, or type quit to end: monkey
    Enter an int, double, any random text, or type quit to end: quit
    Integers:
    Integer[0]: 5
    Integer[1]: 10
    Doubles:
    Double[0]: 1.2
    Double[1]: 3.4
    Double[2]: 5.6
    Others:
    Other[0]: test
    Other[1]: monkey
    Any help is greatly appreciated!!!
    Thanks!
    Edited by: sublimeph03nix on Jan 21, 2009 7:24 PM

    My professor told me to add sc.next(); because she said when you hit return its reads that in the scanner class too, so it's kinda to clear the buffer I think, I wasn't really sure. It changes nothing on the front end if I remove it.
    As for the thing, it wont let me edit for some reason.  I'll try again in a bit.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Mail rules work for some users, don't work for others

    Ready to pull my hair out over this one:
    Leopard to Snow Leopard upgrade went uneventfully, except for the fact that server-side mail rules (accessed via browser at FQDN -> Mail Rules) work for several users (two, to be exact) and don't for the rest (about 15 or so).
    The usual culprits have been reviewed: 'Enable Server-Side Mail Rules' is checked in Mail -> Settings -> Filters, 'Allow users to configure server-side mail rules' is checked in Web -> Sites -> Web Services, users can create vacation notices and email rules without issue via browser, permissions look fine on the contents of /Library/Email Rules and /var/spool/imap/dovecot/sieve-scripts, logs give no indication of any foul play (at least the Email Rules -> debug.log generates the same entries for both functional and non-functional users), etc.
    I have noticed that /var/spool/imap/dovecot/sieve-scripts contains only two items, which - you guessed it - line up with the GUIDs of the two functional users. Theoretically every user with a rule should be represented here.
    As suggested in this thread:
    http://discussions.apple.com/thread.jspa?messageID=11171395&#11171395
    I created both a vacation notice and an email rule for several users, thinking that may force the folder creation for those users, but no dice. I even manually created folders for a few users with their GUIDs as the folder names and assigned each user ownership and read/write access. Still nothing. Created a few new test user accounts just to rule out any legacy account weirdness (although it's worth noting that I completely redid the OD and recreated user accounts after the upgrade) and replicated the problem with these, as well. Lastly, used Inspector to compare OD attributes between functional and non-functional accounts, with no glaring differences.
    Help!

    Did you find an answer? I encounter the same problem on my new MiniServer. Deleted and created all users several times, but just for some accounts mail is working.
    Do you have the answer?
    (new to this site, read a lot already, but not found)

  • HT4759 How do I upgrade my iOS I use an iPad one and  some apps don't work for the iOS I'm running , help,

    Help , I don't know how to update my iOS on the iPad one some apps won't work with the one I have and are suggesting that I update . Can someone help me figure this out.

    See the chart below to determine whether you can upgrade your device and what you can upgrade to. If you do not have a Software Update option present on your iDevice, then you are trying to upgrade to iOS 5 or higher. You will have to connect your device to your computer and open iTunes in order to upgrade.
    IPhone, iPod Touch, and iPad iOS Compatibility Chart
         Device                                       iOS Verson
    iPhone 1                                      iOS 3.1.3
    iPhone 3G                                   iOS 4.2.1
    iPhone 3GS                                 iOS 6.1.x
    iPhone 4                                      iOS 7.0.x
    iPhone 4S                                    iOS 7.0.x
    iPhone 5                                      iOS 7.0.x
    iPhone 5c                                     iOS 7.0.x
    iPhone 5s                                     iOS 7.0.x
    iPod Touch 1                               iOS 3.1.3
    iPod Touch 2                               iOS 4.2.1
    iPod Touch 3                               iOS 5.1.1
    iPod Touch 4                               iOS 6.1.x
    iPod Touch 5                               iOS 7.0.x
    iPad 1                                          iOS 5.1.1
    iPad 2                                          iOS 7.0.x
    iPad 3                                          iOS 7.0.x
    iPad 4                                          iOS 7.0.x
    iPad Mini                                      iOS 7.0.x
    iPad Air                                        iOS 7.0.x
    =====================================
    Select the method most appropriate for your situation.
    Upgrading iOS
       1. How to update your iPhone, iPad, or iPod Touch
       2. iPhone Support
       3. iPod Touch Support
       4. iPad Support
         a. Updating Your iOS from iOS 5
              Tap Settings > General > Software Update
         If an update is available there will be an active Update button. If you are current,
         then you will see a gray screen with a message saying your are up to date.
         b. If you are still using iOS 4 — Updating your device to iOS 5 or later.
         c. Resolving update problems
            1. iOS - Unable to update or restore
            2. iOS- Resolving update and restore alert messages

  • I need help with some simple code! Please read!

    hi everyone.
    I'm having problems with a piece of code, and i'd be extremely greatful if somebody could give me a hand with it. I'm totally new to java and have to make a program for my university degree, but i'm finding it extremely difficult, mainly due to my total lack of apptitude for this type of thing. I know this is easy stuff, but the books I have are no use so any help would be greatly appreciated.
    I have to write a program which uses two class files. I want one with the code to produce a simple button, and one to invoke it several times at different locations. I decided to write the program as one class file at first, and thought i'd be able to split it up at later. The program works fine when it is one class file. My book said that to split the two classes up, all i needed to do was change the second class to public, although this seems to not work at all. I'm at my wits end on this, and if anyone could correct my code I'd be eternally greatful.
    Here is the first class... (sorry about the lack of indentation)
    >>>>>>>>>>
    import java.awt.*;
    import java.applet.Applet;
    public class Phone extends Applet {
    private Image image;
    public void init() {
    setLayout(null);
    image = getImage(getDocumentBase(), "phone.jpg");}
    public void paint (Graphics g) {
    g.drawImage(image, 0, 0, 700, 530, this);
    PhoneButton myButton;
    myButton = new PhoneButton(20,20);
    >>>>>>>
    This is the second class....
    >>>>>>>
    public class PhoneButton {
    private Button butt;
    public PhoneButton(int a, int b, int c){
    setLayout(null);
    butt = new Button();
    butt.setBounds(a,b,20,20);
    add(butt);
    >>>>>>>>
    My compiler generates errors relating to Button, but i can't do anything to please it.
    Also, could anyone give me some pointers on how to add a different number or symbol to each button. That is what I added int c for, but i couldn't get it to work.
    Cheers in advance.
    Michael Morgan

    I found that there are 5 error in your code.
    1. You should import the "java.awt" package to the PhoneButton.java
    2. The PhoneButton is not a kind of Component. You cannot not add it to the Phone class
    3. the myButton = new PhoneButton(20, 20) does not provide enough parameters to create PhoneButton
    4. You cannot add a Button to a PhoneButton. Becaue the PhoneButton is not a kind of Container
    Fixed code:
    import java.awt.*;
    public class PhoneButton extends Button {
    public PhoneButton(int a, int b, int c){
         setBounds(a, b, 20, 20);
         setLabel(String.valueOf(c));
    ===========================================
    import java.awt.*;
    import java.applet.Applet;
    public class Phone extends Applet {
    private Image image;
    public void init() {
    setLayout(null);
    image = getImage(getDocumentBase(), "phone.jpg");}
    public void paint (Graphics g) {
    g.drawImage(image, 0, 0, 700, 530, this);
    PhoneButton myButton;
    myButton = new PhoneButton(20,20, 1);
    ======================
    Visual Paradigm for UML - Full Features UML CASE tool
    http://www.visual-paradigm.com/

  • Can someone help me write some ASP code please?

    Hello, I'm useless at coding, so would be very grateful if
    someone could
    help me with this piece of code.
    I've got a recordset which returns records with the following
    fields:
    CategoryName, ForumName, Last_Entry_Date.
    There are many ForumNames to one CategoryName
    I was using Tom Muck's simulated nested repeat which on the
    surface was
    doing the job, but it gave me problems when it came to
    styling the table
    because it gives me extra table rows.
    I would like to put each category in a separate table. E.g.
    Table header: Category Name 1
    Table row: Forum 1 Last_Entry_Date
    Table row: Forum 2 Last_Entry_Date
    Table row: Forum 3 Last_Entry_Date
    Table header: Category Name 2
    Table row: Forum 4 Last_Entry_Date
    Table row: Forum 5 Last_Entry_Date
    Table row: Forum 6 Last_Entry_Date
    I guess I need to say for each category write a table with
    the category
    name in the table header cell, then have a repeat region to
    display the
    list of forums for that category, but I don't know how to
    write this loop.
    Can anyone help me please?
    Thanks
    Vicky

    Hi Baxter,
    If you go to
    http://hcmm.org.uk.wehostwebsites.com/forum/forum.asp
    this is the page I'm talking concerned with.
    Vix
    Baxter wrote:
    > Hi! Vicky
    > Do you have a link to the forum page? Need a look.
    > Thanks
    > Dave
    > "Vix" <[email protected]> wrote in message
    > news:ekh11p$pvo$[email protected]..
    >> Hello, I'm useless at coding, so would be very
    grateful if someone could
    >> help me with this piece of code.
    >>
    >> I've got a recordset which returns records with the
    following fields:
    >> CategoryName, ForumName, Last_Entry_Date.
    >>
    >> There are many ForumNames to one CategoryName
    >>
    >> I was using Tom Muck's simulated nested repeat which
    on the surface was
    >> doing the job, but it gave me problems when it came
    to styling the table
    >> because it gives me extra table rows.
    >>
    >> I would like to put each category in a separate
    table. E.g.
    >>
    >> Table header: Category Name 1
    >> Table row: Forum 1 Last_Entry_Date
    >> Table row: Forum 2 Last_Entry_Date
    >> Table row: Forum 3 Last_Entry_Date
    >>
    >> Table header: Category Name 2
    >> Table row: Forum 4 Last_Entry_Date
    >> Table row: Forum 5 Last_Entry_Date
    >> Table row: Forum 6 Last_Entry_Date
    >>
    >> I guess I need to say for each category write a
    table with the category
    >> name in the table header cell, then have a repeat
    region to display the
    >> list of forums for that category, but I don't know
    how to write this loop.
    >>
    >> Can anyone help me please?
    >> Thanks
    >> Vicky
    >
    >

  • I have gotten about 4 emails with a quick time attatchment, but it won't play because it says it is in a format it can't read.  Do I need to download some sort of additional software for this and if so  what?

    I have gotten about 4 emails (Frontier) with quick time attatchments, but it won't play them.  I just get a mesage saying it can't read it in the current format.  Do I need to download additional software and if so what?

    You might try adding Perian.  It can help QT play a with a wide variety of formats.

  • I need help converting an excel formula to javascript for a fillable form.

    Here is the scenario,
    If a person travels for 1 or 2 days we pay out a mealsrate of 75% per day. If 3 or more days we pay # days less 2 days * 25%. I hope that makes sense.
    V7 = Days, F14 = Mealsrate
    Formula in Excel
    =IF($V$7 = 1,$F$14*0.75,($V$7*$F$14)-(($F$14*0.25)*2))  and it works.
    I am VERY NEW to javascript (like yesterday) so don't laugh. I really have no idea what I am doing, but I was trying. Here is what i got. (by the way, It doesn't work)
    if(this.getField( ("Days").value=="1")){
    var f =this.getField("Mealsrate");
    event.value= f.value * .75;
    }else event.value = (Days * f.value)- (f.value *.25)*2;
    I appreciate all the help i can get.
    Tracie
    I'll be back on Monday, I hope I can find my post.

    OK, that Excel formula can be reduced a bit. The following custom Calculate scipt will do what the formula does:
    // Custom Calculate script
    (function () {
        // Get the inputs
        var days = getField("Days").value;
        var rate = getField("Mealsrate").value;
        // Set this field value
        if (days == 1) {
            event.value = 0.75 * rate;
        } else {
            event.value = (days - 0.5) * rate;
    It would make sense to add additional code to deal with negative numbers in either of the input fields.
    Edit: corrected a typo

  • First use of jsp and java bean and "Unable to compile class for JSP" error

    Hi,
    I am trying to create my first jsp + java bean and I get a basic error (but I have no clue what it depends on exactly). Tomcat seems to cannot find my class file in the path. Maybe it is because I did not create a web.xml file. Did I forgot to put a line in my jsp file to import my bean?
    Thank you very much for your help.
    Here is my error:
    An error occurred at line: 2 in the jsp file: /login.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    /usr/local/tomcat/jakarta-tomcat-5/build/work/Catalina/localhost/test/org/apache/jsp/login_jsp.java:43: cannot resolve symbol
    symbol : class CMBConnect
    location: class org.apache.jsp.login_jsp
    CMBConnect test = null;
    I only have this in my directory:
    test/login.jsp
    test/WEB-INF/classes/CMBConnect.java
    test/WEB-INF/classes/CMBConnect.class
    Do I need to declare another directory in classes to put my class file in it and package my bean differently?
    Here is my login.jsp:
    <%@ page errorPage="error.jsp" %>
    <jsp:useBean id="test" type="CMBConnect" scope="session" />
    <html>
    <head>
    <title>my test</title>
    </head>
    <body>
    <h3>Login information</h3>
    <b><%=session.getValue("customerinfo.message")%></b>
    <form> ....... </form>
    </body>
    </html>
    and here is my CMBConnect.java:
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class CMBConnect
    public CMBConnect () { }
    public String openConnection(String id, String password) {
    String returnText = "";
    try {
    Connection con = null;
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    con = DriverManager.getConnection("jdbc:oracle:thin:@myserver.abc.com:1521:TEST", id, password);
    if(con.isClosed())
    returnText = "Cannot connect to Oracle server using TCP/IP...";
    else
    returnText = "Connection successful";
    } catch (Exception e) { returnText = returnText + e; }
    return returnText;
    Thanks again!

    Thanks for you help
    I created the package and I get this error this time:
    javax.servlet.ServletException: bean test not found within scope
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:822)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:755)
         org.apache.jsp.login_jsp._jspService(login_jsp.java:68)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:268)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:277)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:223)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

  • Javascript function is not working for jsp:include.. form elements

    HI,
    I have two jsp's and i will include one jsp in the another jsp, when i do this
    i am not able to access child form elements value using javascript. the javascript
    function is defined in the main jsp. but i could able to get the main form elements
    through javascript
    here is the code.
    main.jsp
    <!--Generated by WebLogic Workshop-->
    <%@ page language="java" contentType="text/html;charset=UTF-8"%>
    <%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
    <%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
    <%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
    <netui:html>
    <head>
    <title>
    Web Application Page
    </title>
    <script language="JavaScript">
    function isValidAge() {
    alert ("hage " +document[getNetuiTagName("MyForm")][getNetuiTagName("age")].value)
    alert ("swage " +document[getNetuiTagName("MyForm")][getNetuiTagName("swage")].value)
    alert ("wage "+document[getNetuiTagName("MyForm")][getNetuiTagName("wage")].value)
    </script>
    </head>
    <body>
    <p>
    <netui:form action="myaction" tagId="MyForm">
    <netui:textBox tagId="age" dataSource="{actionForm.age}"/>
    <netui:textBox tagId="swage" dataSource="{actionForm.swage}"/>
    here i am adding
    <jsp:include page="NewPage.jsp" />
    <netui:button onClick="isValidAge();" />
    </netui:form>
    </p>
    </body>
    </netui:html>
    child.jsp :
    <!--Generated by WebLogic Workshop-->
    <%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
    <table class="tablebody">
    <tr class="tablebody">
    <td> wife age
    <netui:textBox tagId="wage" dataSource="{actionForm.wage}"/>
    </td>
    </tr>
    </table>
    can you tell me is this is bug in hte weblogic portal SP1.
    I am using weblogic portal SP1.
    thanks in advance
    shashi

    in this part:
    if(document.LForm.uname.value==null || document.LForm.upassword.value==null)should be:
    if(document.LForm.uname.value=="" || document.LForm.upassword.value=="")or
    if(document.LForm.uname.value.length==0 || document.LForm.upassword.value.length==0)

Maybe you are looking for

  • Downloading data in excel sheet

    Hi All,     I want to download data in excel sheet. My requirment is to use the same excle sheet to fill data. The next data should be entered in the column of the excel sheet. Is there a possible to write data in excel sheet at a particular row/colu

  • HT4589 I need to open a fcpx v10.1 in fcpx v10.0.8

    I need to open a fcpx v10.1 in fcpx v10.0.8

  • Can't delete the second page in Pages.

    I am designing a newsletter and didn't notice I went past the bottom margin with some of my content creating a second page. Now I can't get rid of the second page! I tried back spacing (deleting) from the top of the second page and that isn't working

  • OCA course material

    anyone who can help me to get the course material of oracle 10g database administration workshop I. Best Regards in advance!!

  • Getting "Unknown Error" when opening a project

    I had the "Adobe Premiere encountered a serious issue" error come up at the end of an edit and now receive "Unknown Error" window when I try to reopen that project. I have tried deleting the .PRV files and have also tried importing the project into a