How to use Classes stored in "Classes" folder in JSP with tomcat ?

Hello friends
im using tomcat as server and MySQL as a Backend. now i am using the date calculation in Diff.class files which i have stored in catalina_home/webapps/prj_dev/Prj_files/classes/diff/DIff.class.
now i am getting error that :
Generated servlet error:
Only a type can be imported. diff.Diff resolves to a package
wht i have to do ?

I don't include the "classes" word in my import anymore.. Waa.. I'm going nuts.. T.T
Now, I'm trying to use the class through useBean..
this is how my application looks like:
/webapps
-----/hangman-jsp
------------index.jsp
------------/WEB-INF
-------------------web.xml
-------------------MysteryPhrase.java
-------------------/classes
---------------------------/beans
----------------------------------MysteryPhrase.class
-----------/images
-------------------hangman.gif
This is what is in my MysteryPhrase:
package beans;
import java.lang.String;
import java.lang.StringBuffer;
public class MysteryPhrase {
     private String answer;
     private StringBuffer mysteryPhrase;
     private int guesses;
     private char[] alphabet;
     public MysteryPhrase () {
     this.alphabet = new char[26];
public void setMysteryPhrase (String mysteryPhrase) {
     this.answer = mysteryPhrase;
     this.mysteryPhrase = new StringBuffer(mysteryPhrase.length());
     for (int i = 0; i < mysteryPhrase.length(); i++) {
          this.mysteryPhrase.setCharAt(i, '_');
public void setGuess (char guess) {
     for (int i = 0; i < answer.length(); i++) {
          if (answer.charAt(i) == guess) {
               mysteryPhrase.setCharAt(i, guess);
     guesses++;
public String getMysteryPhrase () {
     return mysteryPhrase.toString();
public String getAnswer () {
     return answer;
public int getGuesses () {
     return guesses;
This is what is in my index.jsp (It is not yet finished..I just started..)
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="phrase" class="beans.MysteryPhrase"/>
<jsp:setProperty name="phrase" property="MysteryPhrase" value="Hello!"/>
<html>
     <head>
          <title>JSP/JSTL Implementation of Hangman</title>
          <style type="text/css">
               div {
                    color: white;
                    background-color: gray;
                    position: absolute;
                    border-style: solid;
                    border-width: thin;
                    width: 20%;
                    height: 30%;
                    text-align: center;
               #guessBoard {
                    top: 28%;
                    left: 42%
               #mysteryPhraseBoard {
                    top: 50%;
                    left: 25%;
                    z-index: 2;
               #statisticsBoard {
                    top: 57%;
                    left: 58%;
                    z-index: 2;
               #categoryBoard {
                    top: 23%;
                    left: 10%
               #hangman {
                    top: 7%;
                    left: 70%;
               #char {
                    width: 20px;
               body {
                    background-color: black;
          </style>
     </head>
     <body>
          <div id="categoryBoard">
               <form method="post">
                    Please choose a category:
                    <select name="category">
                         <option>Category 1</option>
                         <option>Category 2</option>
                         <option>Category 3</option>
                         <option>Category 4</option>
                         <option>Category 5</option>
                         <option>Category 6</option>
                         <option>Category 7</option>
                         <option>Category 8</option>
                    </select>
                    <input type="submit" value="Change"/>
               </form>
          </div>
          <div id="mysteryPhraseBoard">
               The mystery phrase is
          </div>
          <div id="guessBoard">
               <form method="post">
                    Enter a letter: <input id="char" type="text" name="letter"/>
                    or
                    Enter a word: <input type="text" name="word"/>
                    <input type="submit" value="Guess"/>
               </form>
          </div>
          <div id="statisticsBoard">
               Guesses: 0
               Remaining Letters: 8
          </div>
          <div id="hangman">
               <img src="images/hangman.gif"/>
          </div>
     </body>
</html>

Similar Messages

  • How to Use JavaScript in Controller Class...

    Hi All,
    Can any one tell me how to use JavaScript in Controller Class.
    Requirement is:
    I have
    Radio Group(RG1),
    Two Radio Buttons(RB1,RB2),
    Two messageTextInput(MTI1,MTI2),
    if i click RB1 i should Prompt to the end user to "Enter value for MTI1" or
    If i click RB2 i should prompt "Enter value for MTI2" while submitting page.
    Please let me know the steps to use JavaScript and the above client validation...
    Regards
    Alem...

    Using javascript is against the standard. I can tell you a workaround instead of you setting the javascript, check if that would be acceptable.
    You can use PPR and set the required property on the messageTextInput on clicking of the radio button. By doing this you will let UIX generate the javascript for you to handle the client side validation. But the validation will happen only on click of the submit button. The visual indicator is good enough to tell that the value has to be entered to the item.

  • How to use a stored procedure as a datasource in Crystal Report for Eclipse

    Hi All,
    I've written a stored procedure in oracle 10g with few input parameters and one refcursor output parameter. I want to use this stored procedure as a data source for creating a report in "Crystal Report For Eclipse 3.6.0".
    When I tried to add this stored procedure to the report using the connection explorer, I don't see any option to do this. But when I try to add any table, it shows options like "Add to the current report"....
    Can anybody assist me how to use a stored procedure as a data source in "Crystal Report For Eclipse"?
    Which driver should I use to connect to the oracle database? I tried using JDBC Driver for Oracle.
    Thanks in advance.

    Did you solve your problem? How did you do?

  • How to use a stored procedure in oracle reports

    How to use a stored procedure in oracle reports

    Dear,
    In report triggers you can write your procedure/functions or call it like
    function AfterPForm return boolean is
    begin
    myprocedure(:mydate);
    return (TRUE);
    end;
    Thanks
    Jamil

  • How to use these method of class CL_GUI_PDFVIEWER

    how to use these methods in the class CL_GUI_PDFVIEWER
    1) CREATE_ANNOTATION
    2) GET_ANNOTATION_INFO
    3) SET_ANNOTATION_SETTINGS

    Hi,
       Refer
    https://forums.sdn.sap.com/click.jspa?searchID=10926572&messageID=1803295
    Regards
    Kiran

  • How to use commit work in class cl_bls

    Hi,
    When i have used commit work after email sent,
    it goes into dump.
    Here is the code segment:
      try.
        -------- create persistent send request ------------------------
          send_request = cl_bcs=>create_persistent( ).
        -------- create and set document -------------------------------
          pdf_content = cl_document_bcs=>xstring_to_solix( pdf_tab ).
          document = cl_document_bcs=>create_document(
                i_type    = 'PDF'
                i_hex     = pdf_content
                i_length  = bytecount
                i_subject = sub ).  "#EC NOTEXT
        add document object to send request
          send_request->set_document( document ).
        --------- add recipient (e-mail address) -----------------------
        create recipient object
          recipient = cl_cam_address_bcs=>create_internet_address( recip-recip ).
        add recipient object to send request
          send_request->add_recipient( recipient ).
        ---------- send document ---------------------------------------
          sent_to_all = send_request->send( i_with_error_screen = 'X' ).
         commit work.
          if sent_to_all is initial.
            message i500(sbcoms) with recip.
          else.
            message s022(so).
          endif.
      ------------ exception handling ----------------------------------
      replace this rudimentary exception handling with your own one !!!
        catch cx_bcs into bcs_exception.
          message i865(so) with bcs_exception->error_type.
      endtry.
    What could be the reason?
    Is there any way to use commit work in class while sending email as in SO_NEW_DOCUMENT_ATT_SEND_API1 fm?
    Thanks.

    Hi,
    I have used
    submit program.....
    but in update task i have used it.
    "Z_SD_ORDER_UPDATE".    program is a print driver program.
    However error says:
    There is probably an error in the program
    "Z_SD_ORDER_UPDATE".  
    This program is triggered in the update task. There, the
    following ABAP/4 statements are not allowed:
    -  CALL SCREEN
    -  CALL DIALOG
    -  CALL TRANSACTION
    -  SUBMIT
    I used submit as:
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                      WITH output = ' '
                    AND RETURN.
    Instead of submit i want to use commit work but i also get a dump after commit work too.
    How can i use commit work in above code?
    Thanks.

  • How to Use Pattern and Matcher class.

    HI Guys,
    I am just trying to use Pattern and Matcher classes for my requirement.
    My requirement is :- It should allow the numbers from 1-7 followed by a comma(,) again followed by the numbers from
    1-7. For example:- 1,2,3,4,5 or 3,6,1 or 7,1,3 something like that.
    But it should not allow 0,8 and 9. And also it should not allow any Alphabets and special characters except comma(,).
    I have written some thing like..
    Pattern p = Pattern.compile("([1-7])+([\\,])?([1-7])?");
    Is there any problem with this pattern ??
    Please help out..
    I am new to pattern matching concept..
    Thanks and regards
    Sudheer

    ok guys, this is how my code looks like..
    class  PatternTest
         public static void main(String[] args)
              System.out.println("Hello World!");
              String input = args[0];
              Pattern p = Pattern.compile("([1-7]{1},?)+");
              Matcher m = p.matcher(input);
              if(m.find()) {
                   System.out.println("Pattern Found");
              } else {
                   System.out.println("Invalid pattern");
    }if I enter 8,1,3 its accepting and saying Pattern Found..
    Please correct me if I am wrong.
    Actually this is the test code I am presenting here.. I original requirement is..I will be uploading an excel sheets containg 10 columns and n rows.
    In one of my column, I need to test whether the data in that column is between 1-7 or not..If I get a value consisting of numbers other than 1-7..Then I should
    display him the msg..
    Thanks and regards
    Sudheer

  • How to use the opportunity stub classes to retrieve the opportunity objects

    Hello ,
    I have downloaded WSDL file for opportunity and i have created the stub classes by using axis as WSDL to java. Can any body suggest me , how can i use those created stub classes to retrieve the opportunity objects ?.
    Thanks,
    --bdr_09
    Edited by: bdr on Feb 3, 2009 1:54 AM

    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Tools8.html#63055

  • How to use a static inner class?

    what's the implication of identifier "static" before an inner class.Thank you.

    not sure what implication is, due to my poor vocabulary. But here's an uuh... "example" of a static inner class:
    public class Example {
         static class AnotherClass {
    }There you have class "Example" with the static inner class "AnotherClass." If you wanted to use "AnotherClass" you would do something like:
    public class Whatever {
         Example.AnotherClass ac = new Example.AnotherClass();
    }I don't think I'm mistaken there, but if I am someone please correct me.

  • How to use members through several classes?

    Hi all,
    I have member a, b, c in class A, then class B call a and b, then C call and calculate them as well. Finally, Class D calculates c according to C result. How can I transmit c efficiently? For instance:
    class A{
    int a=1;
    int b=2;
    int c;
    A(){
    c=a+b;
    class B{
    int a;
    int b;
    int c;
    B(){
    A aIns=new A();
    this.a=aIns.a+1;
    this.b=aIns.b+2;
    this.c=aIns.c;
    class C{
    int a;
    int b;
    int c;
    C(){
    B bIns=new B();
    this.a=bIns.a+1;
    this.b=bIns.b+2;
    this.c=bIns.c;
    class D{
    int c;
    D(){
    C cIns=new C();
    this.c=cIns.c+cIns.a+cIns.b;
    public static void main(String[] arg){
    system.out.println(c);
    Is there any more efficient way to get the c?
    Thank in advance
    David

    You are right. I forgot creating that instance. :-) However, my question is not at that point. What I would like to know is whether I can directly access A.c without going through B and C.
    >
    class D
    int c;
    D()
    C cIns=new C();
    this.c=cIns.c+cIns.a+cIns.b;
    public static void main(String[] arg
    System.out.println(c);
    }This code will NOT get c at all. c is a instance
    attribute of class D and you never created an instance
    of D !!
    What you would need to do is :
    class D
    int c;
    D()
    C cIns=new C();
    this.c=cIns.c+cIns.a+cIns.b;
    public static void main(String[] arg
    D newD = new D();
    System.out.println(newD.c);

  • How too use the string tokeniser class to format date strings

    Using the code below I want to write a method which takes a string as a parameter and process it as follows:
    Input: 21/07/62
    Output: 21st July 62
    I wish to do this using the string tokenizer class. Can anyone help??
    import java.io.*;
    public class Input
    public static void main(String args[]) throws IOException
    String theString;
    BufferedReader stdin = new BufferedReader(
    new InputStreamReader(System.in));
    System.out.println("Enter your string now please");
    theString = stdin.readLine(); // throws IOException
    System.out.println("You entered ***" + theString + "***");
    }

    You can certainly use a StringTokenizer to parse your date into three numbers but I think you should use SimpleDateFormat, which will even help you generate your desired format: http://java.sun.com/j2se/1.4/docs/api/java/text/SimpleDateFormat.html

  • How to use the Stored Procedure to update my UDF

    I want to use the Stored Procedure to update my UDF U_InstokCS when the warehouse "OnHand" was changed. The UDF is display the stock by cases. I copied the query as follewing. I couldn't see any thing in the UDF after I made some transactions. Can anybody tell me why? How to continue it?
    if @transaction_type in ('A','U','D') and @Object_type='64'
    begin
    Update OITW
    Set U_InstokCS = OnHand/(Select T0.NumInBuy from [DBO].[OITM] T0
    Where T0.ItemCode = @list_of_cols_val_tab_del)
    Where ItemCode = @list_of_cols_val_tab_del
    end
    Thanks.
    Ying Zhang

    Ying,
    The use of any stored procedures against the SAP Business One database is not allowed per SAP Support.  There is not an instance where you can use SP's.  The ONLY SP that you are allowed to use is the SBO_SP_TransactionNotification SP that comes with SAP Business One itself. You can read about the use of this SP from this article...
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e991e2b9-0901-0010-0395-ef5268b00aaf
    Eddy

  • How to use Parameterized Stored Procedure in OBIEE 10 g..?

    Hi All,
    In my rpd, to load the data in the Physical layer, I'm using a Stored Procedure (*SQL Server Stored Procedure*).
    This stored procedure is using some parameters, so my intention is
    1) Provide prompts for each parameter
    2) Allow the user to select parameter value from the prompt
    Can some one let me know if this is possible and if so how to do this.
    Thanks in Advance
    Mithun

    Dear,
    In report triggers you can write your procedure/functions or call it like
    function AfterPForm return boolean is
    begin
    myprocedure(:mydate);
    return (TRUE);
    end;
    Thanks
    Jamil

  • How to use FPM event in Launchpad Folder

    Hello Experts,
    We have a requirement in which we want to navigate to the Service on clicking the folder name of the launchpad. As this folder is going to have only one service inside it , it does not make any sense to go inside the folder and then access the service by clicking on the service link.
    Do you have any suggestions how we can do this.
    I was expecting that we can use the 'FPM Event ID'  of the Launchpad folder for this , but now sure how to use it.
    Please let me know how we can do this , and if  this can be done by 'FPM Event ID'  how to do that.
    Attached is image about the 'FPM Even ID' which i think i can use.
    Thanks
    Amol

    check this document on Actions configurations in Launchpad
    https://help.sap.com/erp_hcm_ias_2013_01/helpdata/en/5f/b1aa2dcdd54783b6ee557ce1abcb8e/content.htm?frameset=/en/63/61982…

  • How to use custom HTML page in flex web application with out using iframe

    Hi all,
              I have to import a custom HTML page (that has got links to another html pages) inside my flex web application and i dont want to use IFrame. Can you please suggest me with best example.
    Please help me out as i'm new to flex.
    Thanks,
    Swetha.

    Hi, there:
    Best thing to do is to start with the default login.html page, and then modify it. The login screen is fairly complex and it's easy to just miss a JS function you need to call. To get to default page, you would need to do one deploy (to simulator or whatever), and then look for login.html page in the temporary Xcode or Android project generated from the deployment. It should be under the "deploy" directory in your JDev workspace.
    You can also see all the framework JS files and CSS files that way as well.
    We have had customers implementing custom login screen so we know it can work, but they all had to start with the default login screen and then modify it.
    Thanks,
    Joe Huang

Maybe you are looking for

  • Oracle 8.1.7 installation problem on HP-UX

    Here is my set-up: #uname -a HP-UX hostname B.11.11 U 9000/810 #getconf KERNEL_BITS 32 Problem: I am installing Oracle 8i Enterprise Edition using Typical Installation Type. At the 73% progress bar status, the installation process gets stuck. The ins

  • GDI+ Generic Error, multple frame tiff, multiple image formats

    This is a question I posted on stack exchange, but have not gotten any answers.  This is occurring on Windows Server 2008 R2 systems. I have seen many issues involving the GDI+ Generic Error, but I have not seen this particular matter raised before.

  • HP Photosmart 7520 e-All-in-O​ne Printer when trying to photocopy says incorrect paper size

    HP Photosmart 7520 e-All-in-One Printer - WHEN i AM TRYING TO MAKE A COPY COPY OF AN A4 DOCUMENT WITH A4 PAPER INSTALLED.  iT KEEPS PUTTING THROUGH A BLANK SHEET AND SAYING INCORRECT PAPER SIZE.   HELP!! I HAVE CHECKED FOR UPDATED SOFTWARE ETC, CLEAN

  • Payment execution error

    HI           this is maqdoom ali        I getting error while go to the execution of payment terms error no f5413.   Best Regrt   NASERK.

  • Bugs in recent update of iOS and iBook

    I have browsed some of ebooks (epub2 and epub3) on new release of iBook application (version 4.0 (2578) with iOS8.0.2). Some of them are: Incorrect rendering of superscript. Inline equation captured in <img> element always starts with new line while