Take the project name/demoweb as an example:The accessed JSP is: http: // localhost: 8080/demoweb/test/index. jsp.
1. Obtain the relative and absolute paths of the current application in JSP.(1) obtain the Project name: request. getcontextpath ()Result:/demoweb
(2) obtain the full path of the current page containing the Project name: request. getrequesturi ()Resu
Today, record the problems you encountered before: Project deployment in window login can be completed quickly, after deployment to Linux, the first logon process becomes very slow.By looking at the system log, the discovery time is mainly consumed in the creation session, and is located to the SecureRandom initialization problem, continue to view, found that the session ID is created as a UUID, here, the person familiar with Linux will understand the
work will bring some interns or newcomers, most of the lack of experience, project debugging is their headache, the code out of the problem is often helpless, very affecting the efficiency. In fact, code debugging is a step to follow, the code out of the problem to do the first thing is to locate the problem, only know where the problem can be solved.
A Java Web
write, to generate a complete module, with pages, SQL scripts, processing classes, service and other complete modules2 Ali database Connection pool Druid, security permissions Framework Shiro, cache framework Ehcache, Tool class interface Redis3 Integrated WX Interface Development WX custom menu (support multiple public numbers)4 Image crawler Technology Enter the URL of the picture, can crawl and download the picture of this page to the local server5 SQL Editor, supports complex SQL statements
To do web development, testing is a very time-consuming thing. So we should test it in a simpler and quicker way. Let's introduce a lightweight container--jetty today. J today said Etty is a maven plug-in Jetty-maven-plugin, with Maven to use very convenient, its configuration is very simple, below we see how it works!Under the so the configuration is complete, then right-click on the Pom.xml file, point to Run as, select Maven build, enter "Jetty:r
MAVEN builds Java Web Project 1. MVN Archetype:generate-darchetypeartifactid=maven-archetype-webapp If you are using Eclipse, you can create a new MAVEN project for WebApp. to the same.2. Add plugin> groupId>org.mortbay.jettygroupId> artifactid>maven-jetty-pluginartifactid> version>6.1.7version> plugin> 3. MVN Tom
Open SoftwareClick Create New ProjectSelect Empty Project, click NextWrite the workspace name, click the Finish button, and the pop-up box is OK.Configure the JDK (without dot new) and click OKSelect File>new Module ...Left navigation bar Select Java, right tick Web application, then click NextWrite your own project na
When writing a Java Web project, you need to define a lot of JSP files, if all the unified in the root directory of the webcontent looks like a mess, time has long been unable to find the specific JSP file corresponding function is what, Therefore, it is best to customize the folder in the root directory of webcontent to store JSP files of different function
Java WEB Manual Deployment project steps1 Create the folder (Eg:demo) that needs to be deployed under the webapps below Tomcat;2 Set up Web-inf weta-inf src folder under demo;3 Create a new Servlet.java file under SRC4 Build the Classes and Web. xml files under
=internal , without this parameter, will be very slow when Maven builds the skeleton, and sometimes it will get stuck directly.Explanations from the Internet:
Archetypecatalog represents the plug-in uses the archetype metadata, does not add this parameter when the default is Remote,local, that is, the central warehouse archetype metadata, because the central warehouse archetype too much, so the result is very slow, Specify internal to indicate that only internal metadata is used.
N
Maven builds the skeleton, and sometimes it will get stuck directly.Explanations from the Internet:
Archetypecatalog represents the plug-in uses the archetype metadata, does not add this parameter when the default is Remote,local, that is, the central warehouse archetype metadata, because the central warehouse archetype too much, so the result is very slow, Specify internal to indicate that only internal metadata is used.
Next, fill in the pro
Maven builds the skeleton, and sometimes it will get stuck directly.Explanations from the Internet:
Archetypecatalog represents the plug-in uses the archetype metadata, does not add this parameter when the default is Remote,local, that is, the central warehouse archetype metadata, because the central warehouse archetype too much, so the result is very slow, Specify internal to indicate that only internal metadata is used.
Next, fill in the pro
Objective:As we all know, the most in project development is nothing more than adding and deleting (CRUD) operations. Since the development of the SSH framework, the development and development process of the domestic Web project has become more and more flexible; This paper makes a simple extraction of the business layer code in the
1.File---->new---->other---->web---->dynamic Web Project 2. Next 3. Select Add Item Project name:test1234. Select Tomcat Configuration 5. Choose the Tomcat configuration, depending on the version of Tomcat on the machine, generally used v6.0 6. Add a toolset without selecting, next. 7. Create a JSP 8 under
First create a classpublic class Contextinitlistener implements ServletcontextlistenerMakes the Class A listener. Used to listen to the entire container life cycle, primarily initialized and destroyed.After the class is created, add a simple listener configuration to the Web. XML configuration file, which is the class that we just defined.XML codeListener> Lang:xml - Description>ServletcontextlistenerDescription> Lang:xml - Listener-class>Com.
1. Installation ToolsThe first step is to download and install the JDK and configure the environment;To configure an environment variable step:(1) New variable name: Java_home, the value of the variable is the installation path of the JDK;(2) Open path, add variable value:%java_home%\bin;%java_home%\jre\bin;(3) New variable name: CLASSPATH, Variable value:%java_home%\lib\dt.jar;%java_home%\lib\tools.jar.Verify that the configuration was successful: Enter the
A solution for displaying garbled characters in HTML files in a Java Web project in a browser
When I was working on a Java Web project today, Chinese characters in html are garbled in the browser. The possible causes are as follow
Code debugging methods for Redis in JAVA Web projectsRedis is used in the development of the project, it is necessary to debug the correctness of the output data,Method One: Modify the code and temporarily do not fetch data from RedisMethod Two: Clear all keys in the Redis databaseLog in to the REDIS server and switch directories to the Redis directory:cd/opt/red
Add deploymentCopy SVN address, in the local checkout out, packaging their own web project and renamed to ROOT.WAR,SVN submitted, click on the quick release, after the success of the post 1-3 seconds to click on the domain name can directly access their own small projects!Project Structure diagram:http://kingjames.duapp.com/This is an introductory case of a littl
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.