How should Java projects be deployed?

Source: Internet
Author: User

It's really a headache when it comes to this question.

Before in the school has also done some projects, of course, the school is in pediatrics, remember to get the project deployment time, get a long time, online search information, so that ...

The final result, for example, is that I have a project testspringannotation

When I deploy, I copy the Tomcat 6.0\webapps\testspringannotation to the server, install the database, import the database tables, and so on, then modify the database connection files, recompile, and overwrite the files on the server ...

It's what you visit, localhost:8080/testspringannotation/pages/pagename.jsp.

It seems to be simple, but it took a long time to get it. O (∩_∩) o~

Recently joined the work, today asked the master a path problem, extended to the deployment of the problem up

That's what I did before:

See, visit http://localhost:8080/testspringannotation/

Will jump to my login page, login page:

<body>

<s:if test= "#session. Login==1" ><span style= "color:red;" >* username or password is wrong, please login again </span></s:if>

<s:form name= "LoginForm" action= "login!login.action" "Master said it can not use this path, to use relative to the path of the project root path, from the background to obtain specific reasons: I am not very clear" method= "POST" >

<s:textfield name= "username" id= "username" label= "username" ></s:textfield>

<s:password name= "Userpass" id= "userpass" label= "password" ></s:password>

<s:submit value= "Login" onclick= "return log ()" ></s:submit>

</s:form>

</body>

The front is a little off, but always feel useful, on record

Here's the question of deployment:

Deployed in the original way, we http://localhost:8080/testspringannotation/this access

Open D:\Program files\tomcat 6.0\conf\tomcat-users.xml file, we will see the following configuration:

<tomcat-users>

<role rolename= "Manager"/>

<role rolename= "admin"/>

<user username= "admin" password= "" roles= "Admin,manager"/>

</tomcat-users>

Okay, then visit http://localhost:8080/.

Click on the left Tomcat Manager to log in with username and password above

You will find that your project is inside, and can be stopped, you can uninstall "here the master mentioned a plug-in, specifically how, I am not very clear"

I don't know what the problem is here, but I have a feeling that my project is being controlled by others.

So, how to solve this problem.

1, copy the project D:\Program Files\tomcat 6.0\webapps below to another path "my: E:\testspringannotation"

2, you can modify a name for the project "E:\map Here's why I want to get the path from the background in fact, I'm not particularly clear about this one.

3, open D:\Program files\tomcat 6.0\conf\server.xml, add the following

<context path= "" docbase= "E:\map" reloadable= "true" >

</Context>

</Host>

4, delete D:\Program Files\tomcat 6.0\webapps under your project

5, start Tomcat

6, visit http://localhost:8080/you will find that this is your project

Content on these, the reason, slowly study it well first make a record

Bits and pieces, hope to be helpful to you, have what opinion, idea what, welcome comment ha

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.