JAVA/JSP Learning Series III (Resin+apache installation) _jsp programming

Source: Internet
Author: User
First, the preface

For starters, it's a good choice to implement JSP and Servlet,tomcat. You can also use resin, these two products can not spend a penny. Resin's support for XML is good.

Second, download, install

Download address for Resin official site: http://www.caucho.com/.

From this address can be downloaded: http://www.caucho.com/download/index.xtp, I downloaded the Resin1.1.4 version.

After downloading, extract to a directory, I use E:\resin114 as an example.



Third, the configuration

Before that, of course we have to install Apache first, and it works.

(1) Configure Apache

Open the httpd.conf file under Apache's Conf subdirectory and edit it with the text Editing tool. Add the following lines:

LoadModule caucho_module "E:\resin114\srun\win32-1.3.6\mod_caucho.dll"

Addmodule mod_caucho.c

<ifmodule mod_caucho.c>

Cauchoconfigfile "E:\\resin114\\conf\\resin.conf"

<Location/caucho-status>

SetHandler Caucho-status

</Location>

</IfModule>

Note: The steps above can also be implemented in a simpler way, which is to run the Setup.exe directly under the E:\resin114\bin\ directory, hook Apache, then apply, and finally OK. In this way, these lines should be added automatically.

(2) Configure resin

In the Resin conf subdirectory there is a resin.conf file that backs up the file one. Then create the resin.conf file, as follows:

<caucho.com>


<error-log id= ' Log/error.log '/>

<classpath id= ' web-inf/classes ' source= ' web-inf/classes ' compile= ' true '/>

<servlet-mapping url-pattern= '/servlets/* ' servlet-name= ' invoker '/>

<servlet-mapping url-pattern= ' *.xtp ' servlet-name= ' Com.caucho.jsp.XtpServlet '/>

<servlet-mapping url-pattern= ' *.jsp ' servlet-name= ' Com.caucho.jsp.JspServlet '/>


</caucho.com>

Four, test

(1) Start resin:

There is a srun.exe under resin bin, run it, and a window will appear.






(2) Make a simple JSP file test.jsp (we use the example of resin site)

The file is placed in: apache/htdocs/test.jsp

The contents are as follows:

<%@ page Language=javascript%>

2 + 2 = <%= 2 + 2%>

(3) Running

Enter in the browser: http://localhost/test.jsp, the following results should appear:

2+2=4

OK, here you have successfully installed, you can build some of your own subdirectories under Htdocs, manage files.

Note: in four (1), start resin can add srun to Win2000 service, so that each time the resin service automatically starts, do not have to run srun.exe every time.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.