Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: JSP class files

  1. #1
    Junior Member
    Join Date
    Jun 2013
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default JSP class files

    Hi,

    I have transformed the web application pages and generated some .class files that are altered according to my needs and now I want my apps to run from these new .class files.
    How can I do this? Could anyone guide me?

    This question might seem naive but, I have altered the code of some functions inside the class files but the JSP files are still the old ones so how should it work?
    Is this correct that because the JSPs are finally turned into classes and when the app runs the class files are executed therefore the JSPs are not important?

    Could anyone clarify please?


  2. #2
    Member
    Join Date
    Jul 2013
    Posts
    219
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default Re: JSP class files

    Hello.
    Let me point out the errors you have in your jsp.
    Firstly, you are missing import statement. By default, java.sql package is not imported. So you have to import it using "page" directive.
    Secondly, you don't have to externally declare HttpServletRequest and HttpServletResponse objects. They are available built-in in JSP.
    So directly use the JSP built-in objects to read the parameter and write the response. I think its "request" for HttpServletRequest. Just google it.
    Thirdly, you did not define some methods. One is getParam(). Where is it defined?
    Don't think of any classes now.
    Your JSP page will ultimately be reduced to a servlet and JSP engine will take care of it.

    Once again,
    -- import the necessary packages
    -- use JSP built-in objects to read the URL parameters. It is "request".
    -- provide the definition of the methods you have defined such as getParam().

    Let me know if the problems still persist.

    Syed.

  3. #3
    Junior Member
    Join Date
    Jun 2013
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: JSP class files

    Quote Originally Posted by syedbhai View Post
    Let me point out the errors you have in your jsp.
    Hi and thanks for your reply.
    I should say that you are totally right those parts are missing but they are all included in the common page. There is no problem with the JSp codes they work fine because they have been generated with CodeCharge and have been tested for many years.
    I have altered some parts of the java code and saved the altered pages as .class files.
    At the moment I need to get sure that the way I test the altered apps is correct (copying the new altered .class files inside the dir .../org/apache/jsp/) I need to run the apps from the new altered .class files not the old ones that do not have the altered parts.

    Regards

  4. #4
    Junior Member
    Join Date
    Jun 2013
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: JSP class files

    Can anyone please guide me in the issue mentioned above?

Similar Threads

  1. JSP class files
    By user2013 in forum What's Wrong With My Code?
    Replies: 13
    Last Post: August 5th, 2013, 03:06 PM
  2. Not able to compile JSP files using Eclipse and Oracle iSuites Apache 1.3
    By ajaykumar6201 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: December 27th, 2012, 01:18 AM
  3. JAR vs. .class files.
    By atar in forum Java Theory & Questions
    Replies: 2
    Last Post: April 10th, 2012, 09:39 AM
  4. importing class files :S
    By b3ard in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 2nd, 2010, 03:45 AM
  5. RFID Class to JSP
    By cramlime in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: June 25th, 2010, 02:32 AM

Tags for this Thread