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 14 of 14

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 everyone,

    I have a question that I would be grateful if the experts guided me.
    I have a JSP web app that I altered its class files and I want to run the application based on its new class files. If I simply replace the new ones with the old ones and run the web app would it be enough?

    Regards


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: JSP class files

    What happened when you tried?

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

    Default Re: JSP class files

    I run the web app and its still the old one not the new one.
    I have made some changes in the code that I do not get the result I want therefore, I thought that this might not be the right solution.
    It seems that the solution mentioned earlier is correct is that right?
    If not is there some other solutions?

    When I run my app I have altered classes and JSP pages with the old code, I have no clue how this run will help me because the source is still old. I know this might seem a very simple question but, could anyone guide me please?

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

    Default Re: JSP class files

    Hello.
    Do you mean you have your custom classes for some custom JSP tags.
    If so then you will have to recompile your classes.
    If not then let us know if you still have any problems.

    Syed.

  5. #5
    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
    Do you mean you have your custom classes for some custom JSP tags.
    I do not totally understand you.
    I have made some changes inside some functions of the application and as these changes are done in the class files not the actual source codes of the JSP app I do not know how I can exactly run my apps with the changed form not the old one. Is the solution mentioned earlier correct or do I need to do something else? Please guide me.
    If there is anything else that I should clarify please let me know.

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

    Default Re: JSP class files

    Hello.
    Some JSP tags are standard such as <jsp:include>, etc. If you are using only standard tags then there is no issue with classes.
    If you have your own defined tags such as <tag1>, <tag2>, etc. then you will have to write your own classes to perform actions for the tags. When you change the code of these classes then you will have to recompile them and give it to the JSP engine.
    So know tell us if you are using any user-defined tags.
    Or else just put your jsp code on the forum and tell us what problems you are experiencing.
    We shall help you appropriately.

    Syed.

  7. The Following User Says Thank You to syedbhai For This Useful Post:

    user2013 (August 3rd, 2013)

  8. #7
    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
    Or else just put your jsp code on the forum and tell us what problems you are experiencing.
    Hi and thanks for your reply.
    I'm not sure but I think I have the first situation (the application is not written by me and its a test case). Here is a sample:

    <%@ include file="Common.jsp" %><%!
    ...

    %><%

    ....
    %>
    <html>
    <head>
    <title>SVEC - Silicon Valley Engineers Club</title>
    <meta name="GENERATOR" content="YesSoftware CodeCharge v.1.2.0 / JSP.ccp build 05/21/01"/>
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="expires" content="0"/>
    <meta http-equiv="cache-control" content="no-cache"/>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    </head>
    <body style="background-color: #FFFFFF; color: #000000; font-family: Arial, Tahoma, Verdana, Helveticabackground-color: #FFFFFF; color: #000000; font-family: Arial, Tahoma, Verdana, Helvetica">
    <jsp:include page="Header.jsp" flush="true"/><center>
    <table>
    <tr>

    <td valign="top">
    <% Search_Show(request, response, session, out, sSearchErr, sForm, sAction, conn, stat); %>

    </td>
    </tr>
    </table>
    <table>
    <tr>
    <td valign="top">
    <% Members_Show(request, response, session, out, sMembersErr, sForm, sAction, conn, stat); %>

    </td>
    </tr>
    </table>

    <jsp:include page="Footer.jsp" flush="true"/>
    <center><font face="Arial"><small>This dynamic site was generated with <a href="http://www.codecharge.com">CodeCharge</a></small></font></center>
    </body>
    </html>
    <%%>
    <%
    ..
    %>
    <%!
    %>


    If you agree with me and its the first case why is there no issue with the classes? Do you mean that everything is OK? If so why is it like this, I have changed part of the java code inside. Is there nothing that I should do so that the application is executed with its new code?

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

    Default Re: JSP class files

    Hello.
    I think we have one separate forum for JSP.
    Just put your JSP code and the classes there.
    It shall be better everyone knows it.
    If it is not acceptable by the forum then you can email me.

    Syed.

  10. #9
    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
    I think we have one separate forum for JSP.
    Just put your JSP code and the classes there.
    Sorry, but I have changed my reply. Could you please check it?

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

    Default Re: JSP class files

    User2013,
    Yes, you are actually in the first case. You are not using any custom JSP tags.
    You are actually invoking java methods using scriptlets (<% ... %>).
    But before calling these methods you will have to define them as well.
    For defining your methods you have to use declarations (<%! ... %>).

    So please using declarations first define your methods. Then using scriptlets invoke these methods.

    By the way you are including common.jsp file. Check if these methods are defined there or not.

    Syed.

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

    Default Re: JSP class files

    Hi,
    Sorry for the delay @Syed. As you mentioned I had forgotten to include the related functions in my code. I have now included them and I still do not get what I want.

    If I'm not mistaking you said I should just copy the new class files in .../org/apache/jsp/ and just run my app. I still do not get it why this is enough. I have altered the code of some functions inside the class files but the JSP files are still the old ones.

    This question might seem naive but, is it that because the JSPs are finally turned into classes, when the app runs the class files are executed therefore the JSPs are not important?

    Could you clarify please?

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

    Default Re: JSP class files

    Hello.
    Can you please post your entire jsp code.
    Let me have a look at it.

    Syed.

  14. #13
    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
    Hello.
    Can you please post your entire jsp code.
    Should I post it here or on the jsp forum you mentioned earlier?

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

    Default Re: JSP class files

    Yeah. You can put it on JSP forum.

    Syed.

Similar Threads

  1. 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
  2. JAR vs. .class files.
    By atar in forum Java Theory & Questions
    Replies: 2
    Last Post: April 10th, 2012, 09:39 AM
  3. How to edit .class files in Eclipse
    By xbill in forum Java IDEs
    Replies: 2
    Last Post: April 22nd, 2011, 02:31 PM
  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