1. Become a Developer for CrazyEngineers - Apply NOW!

How to run JSP on XAMPP

Discussion in 'Computer Science | IT | Networking' started by ahj.ashish, Mar 22, 2013.

  1. ahj.ashish

    ahj.ashish Apprentice

    Engineering Discipline:
    Computer Science
    I have installed xampp v1.8.1 on my laptop and i wanted to run few jsp pages using it. Can anyone please help with instructions on how to do that?
     
  2. CrazyEngineeres T-Shirts Store
  3. Kaustubh Katdare

    Kaustubh Katdare Administrator

    Engineering Discipline:
    Electrical
    First make sure tomcat is installed, if not get the addon from: http://www.apachefriends.org/en/xampp-windows.html

    If required, configure tomcat port number to avoid conflict (should not be required, but better check) -
    Look for the following on tomcat install directory -

    Code:
    C:\xampp\tomcat\conf\server.xml
    <Connector port="9000" protocol="org.apache.coyote.http11.Http11AprProtocol"
    connectionTimeout="20000"
    redirectPort="8443" />
    Check User Name and Password for Tomcat
    C:\xampp\tomcat\conf\tomcat-users.xml

    Code:
    <tomcat-users>
    <role rolename="manager"/>
    <role rolename="admin"/>
    <user username="xampp" password="xampp" roles="admin,manager"/>
    </tomcat-users>
    Hope this helps.
     
    • Like Like x 1
  4. ahj.ashish

    ahj.ashish Apprentice

    Engineering Discipline:
    Computer Science
    Well thanks sir for the reply but the tomcat is already a part of the basic package with this version of xampp. And as per the codes mentioned above , these are as on my machine :


    Code:
    <Connector port="8080" protocol="HTTP/1.1"
                  connectionTimeout="20000"
                  redirectPort="8443" />

    Code:
    <tomcat-users>
    <!--
      <role rolename="tomcat"/>
      <role rolename="role1"/>
      <user username="tomcat" password="tomcat" roles="tomcat"/>
      <user username="both" password="tomcat" roles="tomcat,role1"/>
      <user username="role1" password="tomcat" roles="role1"/>
    -->
    </tomcat-users>
    
    Should i change these to the ones mentioned by you? and after I do it, what should i do next to get a jsp page running on my browser window?
     
  5. Kaustubh Katdare

    Kaustubh Katdare Administrator

    Engineering Discipline:
    Electrical
    It'd be difficult to respond without knowing what the error is. Are you getting a blank page or some error?
     
  6. Ankita Katdare

    Ankita Katdare Moderator

    Engineering Discipline:
    Computer Science
    In case, if someone is still looking into this and facing an issue, I hope these step by step process can be of help -

    1. Download Apache Tomcat addon here.
    2. Extract tomcat addon in Xampp server root directory
    3. Go to C://xampp/
    4. Stop all services of xampp
    5. Open shell and relocate all services
    6. Enable mod_jk and relocate
    7. Start the services
    8. In Xampp control panel you will see the tomcat service. Activate it.
    9. Click on admin and enter username and password as xampp and xampp
    10. There you go! Open tomcat admin!
     
  7. keshav_1994

    keshav_1994 Newbie

    Engineering Discipline:
    Computer Science
    I m new in making servlet and jsps...

    previously i was using tomcat on eclipse now i want to shift it to xampp....

    i have changeg the port of tomcat at eclipse nd my tomcat server has been started successfully although i didnt get the 5th point told by miss.ankita to relocate services....


    but the problem is i am abe to get :-
    1) where to save jsp file (i saved in ht docs nd i did run it using localhost/calc.jsp)
    but it is showing me the code on browser rather dan the result of application... and the same application works fine on eclipse...


    wat to do?
     
  8. ahj.ashish

    ahj.ashish Apprentice

    Engineering Discipline:
    Computer Science
    In order to run jsp with XAMPP you need to place your .jsp files in the webapps directory of your tomcat folder within your xampp installation folder.

    {xampp_installation_folder}/tomcat/webapps

    and use the http://localhost:8080/{your_jsp_file_name}
    to run your .jsp file.
     
  9. crusadersplanet

    crusadersplanet Newbie

    Engineering Discipline:
    Computer Science
    remove comments
    <!--
    <role rolename="tomcat"/>
    <role rolename="role1"/>
    <user username="tomcat" password="tomcat" roles="tomcat"/>
    <user username="both" password="tomcat" roles="tomcat,role1"/>
    <user username="role1" password="tomcat" roles="role1"/>
    -->

    remove <!-- and -->
     

Share This Page