commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: Adapting legacy request parameters into new POJO?
Date Tue, 13 Apr 2010 02:28:34 GMT

hi mick

download jspapi (version 2.3) and install to local repository
mine is located at 
%USER_PROFILE%\.m2\repository\jspapi\jsp-api\2.3

http://java.sun.com/products/servlet/download.html

you can use this pom.xml to install the jsp-api

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<!-- when glassfish is installed make sure this parent pom is enabled -->
<!-- parent -->
     <!-- groupId>com.sun.enterprise.glassfish</groupId -->
     <!-- artifactId>servlet-jsp-api</artifactId -->    
     <!-- version>10.0-SNAPSHOT</version -->
     <!-- relativePath>../pom.xml</relativePath -->    
<!-- /parent -->

<modelVersion>4.0.0</modelVersion>
            <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
         <packaging>jar</packaging>
         <version>2.3</version>
         <name>Java EE JSP API</name>
         <description>Project GlassFish Java EE JSP API</description>
<developers>
             <developer>
                 <id>kchung</id>
                             <url>http://blogs.sun.com/kchung/</url>
                 <organization>Sun Microsystems, Inc.</organization>
                 <roles>
                     <role>lead</role>
                 </roles>
             </developer>
         </developers>
    <build>
             <sourceDirectory>src/share</sourceDirectory>
             <plugins>
              <plugin>
                 <artifactId>maven-antrun-plugin</artifactId>
                 <executions>
                   <execution>
                     <phase>process-sources</phase>
                     <configuration>
                       <tasks>
                             <copy file="jsp-api.mf" toFile="${project.build.directory}/manifest.mf">
                                 <filterset>
                                     <filter token="VERSION" value="${jsp.spec.version}"/>
                                 </filterset>
                             </copy>     
                       </tasks>
                     </configuration>
                     <goals>
                       <goal>run</goal>
                     </goals>
                   </execution>
                 </executions>
               </plugin>   
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-jar-plugin</artifactId>
             <configuration>
               <archive>
                 <manifestFile>${project.build.directory}/manifest.mf</manifestFile>
               </archive>
             </configuration>
           </plugin>   
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-javadoc-plugin</artifactId>
                 <executions>
                   <execution>
                     <phase>javadoc</phase>
                     <goals>
                         <goal>javadoc</goal>
                     </goals>
                     <configuration>
                       <groups>
                         <group>
                           <title>JavaServer Pages API Documentation</title>
                           <packages>javax.servlet.jsp</packages>
                         </group>
                       </groups>
                       <bottom>Portions Copyright &amp;copy; 1999-2002 The Apache
Software Foundation.  All Rights Reserved. Portions Copyright &amp;copy; 2005-2006 Sun
Microsystems Inc.  All Rights Reserve</bottom>
                     </configuration>
                   </execution>
                 </executions>
           </plugin>   
           </plugins>
             <resources>
                 <resource>
                     <targetPath>javax/servlet/jsp/resources</targetPath>
                     <directory>src/share/dtd</directory>
                     <includes>
                         <include>jsp*.dtd</include>
                         <include>jsp*.xsd</include>                    
                     </includes>
                     <excludes>
                         <exclude>web-jsp*.dtd</exclude>
                         <exclude>web-jsp*.xsd</exclude>                    
                     </excludes>
                 </resource>
                 <resource>
                     <directory>src/share</directory>
                     <includes>
                         <include>**/*.properties</include>
                     </includes>
                 </resource>
             </resources>
         </build>
         <dependencies>
             <dependency>
                 <groupId>javax.servlet</groupId>
                 <artifactId>servlet-api</artifactId>
                 <version>${servlet-api.version}</version>
             </dependency>
        </dependencies>    
 </project>

for some reason the pom.xml that came with the morph project forgot the maven-compile plugin
( so you cannot compile the examples) here is my pom.xml for morph project

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>net.sf.morph</groupId>
  <artifactId>morph</artifactId>
  <packaging>jar</packaging>
  <version>1.1.1</version>

  <description>
    Morph is a Java framework that eases the internal interoperability of an application.
 As information flows through an application, it undergoes multiple transformations.  Morph
provides a standard way to implement these transformations.
  </description>

  <build>
       <sourceDirectory>src</sourceDirectory>
       <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.0.2</version>
            <configuration>
              <compilerArguments>
                <verbose />
                <sourcepath>src</sourcepath>
              </compilerArguments>
               </configuration>
          </plugin>
       </plugins>
  </build>
  <name>Maven Quick Start Archetype</name>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <url>http://maven.apache.org</url>

  <dependencies>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.1.1</version>
    </dependency>

    <dependency>
      <groupId>commons-chain</groupId>
      <artifactId>commons-chain</artifactId>
      <version>1.2</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <optional>true</optional>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>velocity</groupId>
      <artifactId>velocity</artifactId>
      <version>1.5</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>servletapi</groupId>
      <artifactId>servletapi</artifactId>
      <version>2.4</version>
      <optional>true</optional>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>jspapi</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.3</version>
      <optional>true</optional>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils-core</artifactId>
      <version>1.7.0</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.14</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring</artifactId>
      <version>2.0</version>
      <optional>true</optional>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-mock</artifactId>
      <version>1.2.6</version>
      <optional>true</optional>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.4</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <version>3.2.1</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>antlr</groupId>
      <artifactId>antlr</artifactId>
      <version>2.7.7</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>net.sf.composite</groupId>
      <artifactId>composite</artifactId>
      <version>1.1</version>
    </dependency>

  </dependencies>

  <scm>
    <url>svn://development.spiderstrategies.com/morph/Morph</url>
  </scm>
</project>


>mvn compile 
will compile the test examples

a quick grep for main reveals a couple of java testcases we can run
%MORPH_HOME%\src\net\sf\morph\MorphCommandlineTest.java
%MORPH_HOME%\src\net\sf\morph\MorphTestCase.java
%MORPH_HOME%\src\net\sf\morph\MorphTestRunner.java
%MORPH_HOME%\src\net\sf\morph\SpeedComparison.java

HTH
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten
wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist
unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet
keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen
wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire
prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe
quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information
seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les
email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune
responsabilité pour le contenu fourni.




> From: mknutson@baselogic.com
> Date: Mon, 12 Apr 2010 14:33:51 -0400
> Subject: Re: Adapting legacy request parameters into new POJO?
> To: user@commons.apache.org
> 
> Morph seems to have what I think I want, but I have spent the past few hours
> trying to get a simple example working, and the docs are wrong. It referes
> to many classes that doe not exist in the jar.
> 
> I also can not seem to find any other good examples. Can you point any out
> for me?
> 
> ---
> Thank You…
> 
> Mick Knutson, President
> 
> BASE Logic, Inc.
> Enterprise Architecture, Design, Mentoring & Agile Consulting
> p. (866) BLiNC-411: (254-6241-1)
> f. (415) 685-4233
> 
> Website: http://www.baselogic.com
> Blog: http://www.baselogic.com/blog/
> Linked IN: http://linkedin.com/in/mickknutson
> Twitter: http://twitter.com/mickknutson
> Vacation Rental: http://tahoe.baselogic.com
> ---
> 
> 
> 
> On Mon, Apr 12, 2010 at 10:34 AM, Matt Benson <gudnabrsam@gmail.com> wrote:
> 
> >
> > On Apr 11, 2010, at 5:28 PM, Mick Knutson wrote:
> >
> >  I have an interesting issue I am trying to solve in a manageable way.
> >>
> >> I have a few dozen legacy JSP's that I am phasing out. But I have to do
> >> them
> >> 1by1. Each page create a POST of ~12 named request parameters that are ALL
> >> named different. VERY frustrating as there is no good convention.
> >>
> >> So, My thought is trying to create a Map for mapping the old names to the
> >> new names for each POST:
> >> Map reqParam = {"newName", "oldName"}
> >>
> >> Where I have a new POJO that has set/getNewName(..)
> >>
> >>
> >> Then, somehow copying from these old request properties from my request
> >> properties Map to the new one's in my new POJO.
> >>
> >> Once Mapped, I have no further use for the old names.
> >>
> >> Can someone help point me in the right direction to be able to use common
> >> Lang if possible?
> >>
> >>
> > Nothing comes to mind from [lang].  [beanutils] would probably allow you to
> > roll your own solution to this.  You might also want to look into
> > morph.sourceforge.net, whose PropertyNameMappingCopier would probably work
> > for you out of the box.
> >
> > HTH,
> > Matt
> >
> >
> >
> >> ---
> >> Thank You…
> >>
> >> Mick Knutson, President
> >>
> >> BASE Logic, Inc.
> >> Enterprise Architecture, Design, Mentoring & Agile Consulting
> >> p. (866) BLiNC-411: (254-6241-1)
> >> f. (415) 685-4233
> >>
> >> Website: http://www.baselogic.com
> >> Blog: http://www.baselogic.com/blog/
> >> Linked IN: http://linkedin.com/in/mickknutson
> >> Twitter: http://twitter.com/mickknutson
> >> Vacation Rental: http://tahoe.baselogic.com
> >> ---
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
> >
 		 	   		  
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message