Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

« Newer Snippets
Older Snippets »
3 total  XML / RSS feed 

configure maven2 tomcat plugin

pom.xml

  <build>
    <finalName>reload-testfinalName>
    
      
        org.codehaus.mojo</groupId>
        <artifactId>tomcat-maven-pluginartifactId>
        
          http://localhost:8090/managerurl>
          myserver</server>
        configuration>
      </plugin>
    plugins>
  </build>


How to use JSTL fmt:message and resource bundle

To use JSTL fmt:message tags with a message bundle, there are two ways.

First, if there is only one properties file, use, the following code in web.xml file.

  <context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContextparam-name>
    class.path.to.your.resources.bundle</param-value>
  context-param>


Use in the JSP.

Second, if there are multiple properties files, and there are different locales, use
<fmt:setBundle basename="class.path.to.your.resources.bundle"/>

before

Or you can write

<fmt:bundle basename="class.path.to.your.resource.bundle">
  <fmt:message key="your.message.key"/>
fmt:bundle>

Use SVN, Ant and Tomcat in XCode

I found Tim Fanelli's Blog ( http://www.timfanelli.com/cgi-bin/pyblosxom.cgi/j2ee/ ) entry quite helpful

In xcode, create a new empty project with the same dir any sources were checked out from.

Name the project with the same name used as the SVN module. NOTE: the .xcodeproj file should end up in the same directory as your build.xml file.

From the finder, dragged the src/ directory into the top level project name item in the project window.

Removed any unwanted items from the folder hierarchy now in xcode. For example, remove all generated build .jar files.

Project -> New Target. Chose 'Shell Script Target'.

In the new Target, double clicked on "Run Script". Under the "General" tab, entered, "/usr/bin/ant;"

Project -> New Build Phase -> New Copy Files Build Phase

Control + Click "Copy Files" (or right click if you have Mighty Mouse)

Add "Empty File in Project". Choose the dist/ directory. Create a file matching the output from your Ant build e.g. Project.war

Double click on the "Copy Files" phase. Type the absolute path to your tomcat deployment directory.

Project -> New Custom Executable. Enter "Tomcat" and make the path "/usr/bin/java".

Select the Arguments Tab enter:

-classpath /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/commons-logging-api.jar
-Dcatalina.home=/opt/tomcat
-Xmx128m
-Xms64m
-Xincgc
-Djava.awt.headless=true
org.apache.catalina.startup.Bootstrap -debug start


Under the Debugging tab, choose "Java Debugger".
« Newer Snippets
Older Snippets »
3 total  XML / RSS feed