Where should I keep my utility classes...

Hi All,
I have WAR application and few ejb JARs which are sharing common utility classes. I have created a separate folder for my WAR application. ejb jars also are in the serverclasses folder.
Now the question what's the recommended destination for utility classes. Can I keep them in the WAR application.
regards,
Aravind.

If you are totally unsure, you can create a folder somewhere, put the files in it and then add the folder to your $PATH.

Similar Messages

  • HT2509 Where should I keep my fonts folder on my HD

    Where should I keep my fonts folder on my HD?

    I assume you mean third party fonts you've added? If so, pretty much anywhere you want.
    There are already three Fonts folders on the hard drive they're at:
    /System/Library/Fonts/
    /Library/Fonts/
    ~/Library/Fonts/
    The first obviously belongs to the system. If you don't know what you're doing in that folder, leave it alone. The second is the Library you see when you double click the icon of the hard drive on your desktop. Any fonts in that folder can be used by any user account. The last refers to the Fonts folder of the active user. That is, whoever is logged in at the moment. Only that user can access fonts within their account.
    It's not a good idea to activate hundreds, and especially not thousands of fonts at a time. They take up space in RAM when active. They more you have open, the less RAM is available for other apps. Long font lists in apps also very much slow down those menus.
    I would create a folder for your fonts anywhere outside of the three locations I listed above. You can put is right at the root of the drive is you want, next to Applications, Users, etc. You can even call the folder Fonts if you want to. OS X will pay no attention to it, despite the name. It only automatically looks into the three main Fonts folders.
    From there, you can activate fonts within that folder using Font Book, or any other third party font manager. If you're using Font Book, I strongly suggest using Library sets rather than normal sets. With the former, the fonts stay where they are (activated in place) rather than being copied into your user account (a waste of time and disk space).

  • Where should I keep mail jar in jws,mssql

    Dear all
    hi!
    I am writing code for java mail. But where shold I keep mail jar files in server(java web server and mssql)
    My programme is giving error:
    Package javax.mail not found in import. import javax.mail.*;
    ^
    Please guide me,
    thanx,
    Samir

    The error seems to come when trying to compile your code.
    Put the JavaMail package onto the class path!

  • Wher should i keep classes12.zip file

    Hi,
    I am new to java and oracle.I want to connect to database to database using thin driver, but i am un able to connect.I am using j2sdk1.4.2_10 and oracle 8i.
    I have downloaded classes12.zip but don't know where to keep .Can any one help me regarding this issue.
    If possible tell me how many ways we can connect to oracle using java.
    Ashok.

    Ashok,
    The Oracle database distribution should include the JDBC driver. It should be in directory:
    ORACLE_HOME/jdbc/lib
    Where "ORACLE_HOME" is an environment variable, so for a Windows platform it would be:
    %ORACLE_HOME%\jdbc\lib
    And for a UNIX/linux platform it would be:
    $ORACLE_HOME/jdbc/lib
    In any case, it doesn't matter where the "classes12.zip" file is located, you just need to tell java where it is located. There are several ways to do this and the best way depends on the type of application you are using. If you are using a simple, stand-alone java class, then simply use the "-classpath" option of the java command, for example (using UNIX):
    java -classpath $ORACLE_HOME/jdbc/lib/classes12.zip:. YourJavaClass(Note that I have assumed that "YourJavaClass" is in the current directory.)
    Good Luck,
    Avi.

  • General Question - In which way should I store a "UTILS" class

    Hi
    I'm building a web application, ( Tomcat + JSF + Icefaces )
    I got a bunch of methods that are being used in many places...
    In which way should i store them , a Static class with static methods or an Instance of that class that will be stored in Application scope, or some other way of storing this class and accessing it?
    Thanks in advance...

    Utility methods? Just use a final class with a private constructor and only static methods for that.

  • Where should I keep my music?

    I have an external drive with most of all of my music on it and some of that music is actually on the hard drive. I just ripped a bunch of cd's to my external drive and put them in my library and numerous songs have the ! so I locate them, when I search for them on my external they are there. I don't want to have to manually locate each song! any ideas on where to put my music? Do I have to have it on the actual hard drive in order for iTunes to find it automatically.

    You can keep the songs wherever you like, but when iTunes starts up it will look in the place you told it to look when you set up iTunes. If they are not there, that's why you see the excalmation mark. The !
    So if you told iTunes that your library is on external drive (letter) F:\, then that's where iTunes will look next time. If the drive is not connected, with the same letter as before and ready, when iTunes starts up, iTunes will fail to find songs.
    I'm not sure what you mean by "I have an external drive with most of all of my music on it and some of that music is actually on the hard drive". Do you mean that some of your music is on the internal hard drive and some of it is on an external hard drive? If so, then you simply need to make sure that the external drive is ready before iTunes starts up.

  • Where should I keep my Home Movies?

    Hi all
    Just wondering where people think is best to store Home Movie files like ones from camera or iPhone?
    I keep changing my mind, at the minute all files from my iphone go into iPhoto by default. Files from my camera are converted into m4v and sent to iPhoto. But before I kept them in iTunes, as this is on external drive, so keeps my Mac clean.
    So what do you guys do?

    Hello:
    so keeps my Mac clean.
    There is no reason to separate things to do what you indicate above.  Performance is not an issue. 
    Personally, I would never separate things like iTunes from my computer (unless I had space problems).  If you separate them, routine backups are not complete.
    iPhoto would be my choice as that is the default.  Storing movies in iTunes does not allow you to edit, etc.
    Barry

  • Where should I put things on my new computer

    Since I've been running LR (currently 3.6) under Windows XP on a 6 year old HP desktop with an AMD dual core processer I just purchased a Dell XPS 8500 and plan to install LR 4.1 and move my catalogs and images to this new machine.
    The machine came with a 1 TB SATA || hard disk, and I've installed a 240 GB SATA III SSD and installed Windows 7 on it.  I currently have my images on an external 1.5 TB eSATA hard disk connected to the old computer, and expect to connect it to new computer the same way.
    Currently (in LR 3.6) I find I spend most of my time in the library module culling images and selecting a small number to develop.  I generate 100% previews for a shoot, and then switch between grid, loupe, and compare views, frequently zooming to 100% to check and compare critical focus.  Since I develop a much smaller number for photos, and typically do pretty minimal processing, don't spend as much time in the develop module.  Assuming that I'll do the same thing in LR 4.1, my top priority is library and performance, particularly when zoomed to 100%, and secondarily develop performance.
    My question is, to get the best performance, where (on  the SSD, internal hard disk, or external hard disk) should I
    install LR 4.1
    store my catalog(s)
    store the Camera Raw cache
    store my images

    hopefully the rest of the community responds with some of the specifics you are asking, but take a look at
    Lightroom's Help- "optimize performance":
    http://helpx.adobe.com/lightroom/kb/optimize-performance-lightroom.html
    http://www.slrlounge.com/10-tips-to-improve-the-speed-and-performance-of-lightroom-lightro om-performance-guide-part-i
    http://thelightroomlab.com/2011/03/where-should-i-keep-my-adobe-photoshop-lightroom-catalo g/
    -hope these help in the meantime,
    janelle

  • Where should my videos go?

    I recently upgraded my Hard Drive from 80 to 500Gb. In the past I have stored my video clips of my kids, from my cannon elph point and shoot camera, on an external hard drive, not on my Macbook hard drive. But, I find that I never see the video because of it being on an external drive. Now, since I have so much room on my internal hard drive, I am thinking it would be nice to be able to have all my videos in one place, where they could be viewed, edited and created in to a family movie, etc. I would like to move them to my internal drive, unless that is a bad idea>? Here is my question: should I put all the movies into iPhoto, where my photos are currently? Should I put all the movies into iMovie08? Should I buy iLife09 and put them in iMovie09 (is there a noticeable difference for a beginner between iMovie08 and iMovie09)? Should I wait for iMovie10? Should I try some other movie software that will be a good library for my video? It is only movies of my kids, I am not making a hightech hollywood type film. Just a dvd for the grandparents. Is there an application that I can use that will store and organize both movies and videos? Then everything is in one place? So, in a nutshell... where should I keep my videos? Please advise and thanks for listening.

    Try user folder/Movies.

  • For WebLogic 5.1, where should I put my class files for my JavaBeans?

    With JBuilder4, I have built an application with JSP and a few Java Beans (Those JavaBeans are instantiated in those JSP files). There are no EJBs. The package name is called 'onlinetrade'. I have tested the application on JBuilder's web server, it works pretty well.
    Now I am moving this application to WegLogic 5.1. I have encountered a problem with WebLogic 5.1
    and do not know where I should place my JavaBean class files --
    Originally, the JSP files for my application are in package path-- ..onlinetrade\jsp
    and the class files for my beans are in the package path -- ..onlinetrade\jsp\bean\*.class
    Now, with WebLogic 5.1,
    1) I have put my JSP files in
    C:\weblogic\myserver\public_html\onlinetrade\jsp
    2) I have created subdirectory and put my bean class files in
    C:\weblogic\myserver\classfiles\onlinetrade\jsp\bean
    When I started weblogic and the first page - login.jsp page can be up and accessed. But when I login and forward to another JSP page called 'controller.jsp', where a bean is instantiated, I got the following error
    Compilation of 'C:\weblogic\myserver\classfiles\jsp_servlet\_onlinetrade\_jsp\__controller.java' failed:
    C:\weblogic\myserver\classfiles\jsp_servlet\_onlinetrade\_jsp\__controller.java:210: cannot access jsp_servlet._onlinetrade._jsp.registerBean
    probably occurred due to an error in /onlinetrade/jsp/controller.jsp line 53:
    registerBean registerBeanInstance = new registerBean();
    I know the javac is working, and a java file is created upon the JSP page, but the problem is -- the bean class files cannot be found!!!
    Where should I create the package path and put my bean class file so that my JSP pages can pick them up?
    Any help is greatly appreciated!
    Thanks.
    --Tim

    I have mine in WEB-INF/classes

  • In which directory should i keep java class files in oracle apps

    hi
    I have one problem, In which Top & directory should i keep java class files in oracle apps
    krishna

    Hi
    By itself its available in oracle\visappl\au\11.5.0\java\
    thats were the location needs to be placed in the apps.zip.
    Thanks
    Riyas

  • JavaDocError: Utility classes should not have a public or default construct

    Hello all,
    I am trying to comply with some check style errors that i am getting and i cannot seem to figure out what is going on. I have set all non-data members to private, except for call point public static void main(string[] args) and i am still getting this error. "Utility classes should not have a public or default constructor." I cannot figure out what is going on, any help would be greatly welcomed. My code is posted below.
    public final class Main
         * Constant Data Member: RECTANGLE
         * Purpose: contains the constant string representing a rectangle.
         * @deprecated RECTANGLE Representitive string value for a rectangle.
        public static final String RECTANGLE = "rectangle";
         * Constant Data Member: TRIANGLE
         * Purpose: contains the constant string representing a triangle.
         * @deprecated TRIANGLE Representitive string value for a triangle.
        public static final String TRIANGLE = "triangle";
         * Constant Data Member: REGEX_NUMBER_TEST
         * Purpose: contains the constant for numerical test within regex method.
         * @deprecated REGEX_NUMBER_TEST regex string for digit comparison.
        public static final String REGEX_NUMBER_TEST = "^[0-9]+$";
         * Constant Data Member: MAX_ARGUMENTS_RECTANGLE
         * Purpose: contains the constant for the maximum number of allowed
         *          arguments coming in from the command line.
         * @deprecated MAX_ARGUMENTS_RECTANGLE constant for rectangle argument.
         *                                      limit.
        public static final int MAX_ARGUMENTS_RECTANGLE = 3;
         * Constant Data Member: MAX_ARGUMENTS_TRIANGLE
         * Purpose: contains the constant for the maximum number of allowed
         *          arguments coming in from the command line, in the case of a
         *          triangle object.
         * @deprecated MAX_ARGUMENTS_TRIANGLE constant for triangle argument limit.
        public static final int MAX_ARGUMENTS_TRIANGLE = 2;
         * Method: main
         * Purpose: Is the execution point for the program. It is in charge of
         *          initiating validation and the creation and application of
         *          objects and their related draw methods.
         * @param args input from the user.
        public static void main(final String[] args)
            String objectType = null;
            int width = 0;
            int height = 0;
            if(args.length > MAX_ARGUMENTS_RECTANGLE || args.length <
                MAX_ARGUMENTS_TRIANGLE || (args.length == MAX_ARGUMENTS_TRIANGLE &&
                !isTriangle(args[0])))
                 // fails
                outputErrorMessage();
            else
                if ((isTriangle(args[0]) && args.length > MAX_ARGUMENTS_TRIANGLE) ||
                    (!isTriangle(args[0]) && args.length > MAX_ARGUMENTS_RECTANGLE))
                    // fails becuase triangle should only have one argument
                    outputErrorMessage();
                else
                    // passes and proceed
                    objectType = args[0];
                    if (validNumber(args[1]))
                        width = Integer.parseInt(args[1]);
                        if(width == 0)
                            outputErrorMessage();
                        else
    ....

    Add a private constructor.
    private Main() {  }
    ...This way it will be not possible to create an instance because it is not needed to use its static members or methods.
    ref : [http://www.javapractices.com/topic/TopicAction.do?Id=40]
    Bye.

  • Where to keep the java class file which is being used from a form?

    Hi,
    Actually I am developing a form which has a bean area and the data will be displayed in the bean area in the form of grid. And I will register this form with apps and will run the from Oracle apps. I want to know that there is a java class file that is being refered by the form, where should this java class file be placed and is there any other places where any changes are required so that the form runs correctly from the Oracle apps and can find the java class file.
    I am very thankful to each and everyone who will be able answer this question of my.

    do you mean decompiling? there are tons of java decompilers available out there, what exactly are you trying to do here?

  • Re: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't forget about the regular expression potential

    Namburi,
    When you said you used the Reg Exp tool, did you use it only as
    preconfigured by the iMT migrate application wizard?
    Because the default configuration of the regular expression tool will only
    target the files in your ND project directories. If you wish to target
    classes outside of the normal directory scope, you have to either modify the
    "Source Directory" property OR create another instance of the regular
    expression tool. See the "Tool" menu in the iMT to create additional tool
    instances which can each be configured to target different sets of files
    using different sets of rules.
    Usually, I utilize 3 different sets of rules files on a given migration:
    spider2jato.xml
    these are the generic conversion rules (but includes the optimized rules for
    ViewBean and Model based code, i.e. these rules do not utilize the
    RequestManager since it is not needed for code running inside the ViewBean
    or Model classes)
    I run these rules against all files.
    See the file download section of this forum for periodic updates to these
    rules.
    nonProjectFileRules.xml
    these include rules that add the necessary
    RequestManager.getRequestContext(). etc prefixes to many of the common
    calls.
    I run these rules against user module and any other classes that do not are
    not ModuleServlet, ContainerView, or Model classes.
    appXRules.xml
    these rules include application specific changes that I discover while
    working on the project. A common thing here is changing import statements
    (since the migration tool moves ND project code into different jato
    packaging structure, you sometime need to adjust imports in non-project
    classes that previously imported ND project specific packages)
    So you see, you are not limited to one set of rules at all. Just be careful
    to keep track of your backups (the regexp tool provides several options in
    its Expert Properties related to back up strategies).
    ----- Original Message -----
    From: <vnamboori@y...>
    Sent: Wednesday, August 08, 2001 6:08 AM
    Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
    forget about the regular expression potential
    Thanks Matt, Mike, Todd
    This is a great input for our migration. Though we used the existing
    Regular Expression Mapping tool, we did not change this to meet our
    own needs as mentioned by Mike.
    We would certainly incorporate this to ease our migration.
    Namburi
    --- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
    All--
    Great response. By the way, the Regular Expression Tool uses thePerl5 RE
    syntax as implemented by Apache OROMatcher. If you're doing lotsof these
    sorts of migration changes manually, you should definitely buy theO'Reilly
    book "Mastering Regular Expressions" and generate some rules toautomate the
    conversion. Although they are definitely confusing at first,regular
    expressions are fairly easy to understand with some documentation,and are
    superbly effective at tackling this kind of migration task.
    Todd
    ----- Original Message -----
    From: "Mike Frisino" <Michael.Frisino@S...>
    Sent: Tuesday, August 07, 2001 5:20 PM
    Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
    forget about the regular expression potential
    Also, (and Matt's document may mention this)
    Please bear in mind that this statement is not totally correct:
    Since the migration tool does not do much of conversion for
    these
    utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
    the translation tool, and the regular expression tool, and severalother
    smaller tools (like the jar and compilation tools). It is correctto state
    that the extraction and translation tools only significantlyconvert the
    primary ND project objects (the pages, the data objects, and theproject
    classes). The extraction and translation tools do minimumtranslation of the
    User Module objects (i.e. they repackage the user module classes inthe new
    jato module packages). It is correct that for all other utilityclasses
    which are not formally part of the ND project, the extraction and
    translation tools do not perform any migration.
    However, the regular expression tool can "migrate" any arbitrary
    file
    (utility classes etc) to the degree that the regular expressionrules
    correlate to the code present in the arbitrary file. So first andforemost,
    if you have alot of spider code in your non-project classes youshould
    consider using the regular expression tool and if warranted adding
    additional rules to reduce the amount of manual adjustments thatneed to be
    made. I can stress this enough. We can even help you write theregular
    expression rules if you simply identify the code pattern you wish to
    convert. Just because there is not already a regular expressionrule to
    match your need does not mean it can't be written. We have notnearly
    exhausted the possibilities.
    For example if you say, we need to convert
    CSpider.getDataObject("X");
    To
    RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
    Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
    updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
    rule:
    <!--getPage to getViewBean-->
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getViewBean($1ViewBean.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    Following this example a getDataObject to getModel would look
    like this:
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getModel($1Model.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    In fact, one migration developer already wrote that rule andsubmitted it
    for inclusion in the basic set. I will post another upgrade to thebasic
    regular expression rule set, look for a "file uploaded" posting.Also,
    please consider contributing any additional generic rules that youhave
    written for inclusion in the basic set.
    Please not, that in some cases (Utility classes in particular)
    the rule
    application may be more effective as TWO sequention rules ratherthan one
    monolithic rule. Again using the example above, it will convert
    CSpider.getDataObject("Foo");
    To
    getModel(FooModel.class);
    Now that is the most effective conversion for that code if that
    code is in
    a page or data object class file. But if that code is in a Utilityclass you
    really want:
    >
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    So to go from
    getModel(FooModel.class);
    To
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    You would apply a second rule AND you would ONLY run this rule
    against
    your utility classes so that you would not otherwise affect yourViewBean
    and Model classes which are completely fine with the simplegetModel call.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getModel\(]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getModel\(]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    A similer rule can be applied to getSession and other CSpider APIcalls.
    For instance here is the rule for converting getSession calls toleverage
    the RequestManager.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getSession().]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    ----- Original Message -----
    From: "Matthew Stevens" <matthew.stevens@e...>
    Sent: Tuesday, August 07, 2001 12:56 PM
    Subject: RE: [iPlanet-JATO] Use Of models in utility classes
    Namburi,
    I will post a document to the group site this evening which has
    the
    details
    on various tactics of migrating these type of utilities.
    Essentially,
    you
    either need to convert these utilities to Models themselves or
    keep the
    utilities as is and simply use the
    RequestManager.getRequestContext.getModelManager().getModel()
    to statically access Models.
    For CSpSelect.executeImmediate() I have an example of customhelper
    method
    as a replacement whicch uses JDBC results instead of
    CSpDBResult.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
    Sent: Tuesday, August 07, 2001 3:24 PM
    Subject: [iPlanet-JATO] Use Of models in utility classes
    Hi All,
    In the present ND project we have lots of utility classes.
    These
    classes in diffrent directory. Not part of nd pages.
    In these classes we access the dataobjects and do themanipulations.
    So we access dataobjects directly like
    CSpider.getDataObject("do....");
    and then execute it.
    Since the migration tool does not do much of conversion forthese
    utilities we have to do manually.
    My question is Can we access the the models in the postmigration
    sameway or do we need requestContext?
    We have lots of utility classes which are DataObjectintensive. Can
    someone suggest a better way to migrate this kind of code.
    Thanks
    Namburi
    [email protected]
    [email protected]
    [Non-text portions of this message have been removed]
    [email protected]
    [email protected]

    Namburi,
    When you said you used the Reg Exp tool, did you use it only as
    preconfigured by the iMT migrate application wizard?
    Because the default configuration of the regular expression tool will only
    target the files in your ND project directories. If you wish to target
    classes outside of the normal directory scope, you have to either modify the
    "Source Directory" property OR create another instance of the regular
    expression tool. See the "Tool" menu in the iMT to create additional tool
    instances which can each be configured to target different sets of files
    using different sets of rules.
    Usually, I utilize 3 different sets of rules files on a given migration:
    spider2jato.xml
    these are the generic conversion rules (but includes the optimized rules for
    ViewBean and Model based code, i.e. these rules do not utilize the
    RequestManager since it is not needed for code running inside the ViewBean
    or Model classes)
    I run these rules against all files.
    See the file download section of this forum for periodic updates to these
    rules.
    nonProjectFileRules.xml
    these include rules that add the necessary
    RequestManager.getRequestContext(). etc prefixes to many of the common
    calls.
    I run these rules against user module and any other classes that do not are
    not ModuleServlet, ContainerView, or Model classes.
    appXRules.xml
    these rules include application specific changes that I discover while
    working on the project. A common thing here is changing import statements
    (since the migration tool moves ND project code into different jato
    packaging structure, you sometime need to adjust imports in non-project
    classes that previously imported ND project specific packages)
    So you see, you are not limited to one set of rules at all. Just be careful
    to keep track of your backups (the regexp tool provides several options in
    its Expert Properties related to back up strategies).
    ----- Original Message -----
    From: <vnamboori@y...>
    Sent: Wednesday, August 08, 2001 6:08 AM
    Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
    forget about the regular expression potential
    Thanks Matt, Mike, Todd
    This is a great input for our migration. Though we used the existing
    Regular Expression Mapping tool, we did not change this to meet our
    own needs as mentioned by Mike.
    We would certainly incorporate this to ease our migration.
    Namburi
    --- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
    All--
    Great response. By the way, the Regular Expression Tool uses thePerl5 RE
    syntax as implemented by Apache OROMatcher. If you're doing lotsof these
    sorts of migration changes manually, you should definitely buy theO'Reilly
    book "Mastering Regular Expressions" and generate some rules toautomate the
    conversion. Although they are definitely confusing at first,regular
    expressions are fairly easy to understand with some documentation,and are
    superbly effective at tackling this kind of migration task.
    Todd
    ----- Original Message -----
    From: "Mike Frisino" <Michael.Frisino@S...>
    Sent: Tuesday, August 07, 2001 5:20 PM
    Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
    forget about the regular expression potential
    Also, (and Matt's document may mention this)
    Please bear in mind that this statement is not totally correct:
    Since the migration tool does not do much of conversion for
    these
    utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
    the translation tool, and the regular expression tool, and severalother
    smaller tools (like the jar and compilation tools). It is correctto state
    that the extraction and translation tools only significantlyconvert the
    primary ND project objects (the pages, the data objects, and theproject
    classes). The extraction and translation tools do minimumtranslation of the
    User Module objects (i.e. they repackage the user module classes inthe new
    jato module packages). It is correct that for all other utilityclasses
    which are not formally part of the ND project, the extraction and
    translation tools do not perform any migration.
    However, the regular expression tool can "migrate" any arbitrary
    file
    (utility classes etc) to the degree that the regular expressionrules
    correlate to the code present in the arbitrary file. So first andforemost,
    if you have alot of spider code in your non-project classes youshould
    consider using the regular expression tool and if warranted adding
    additional rules to reduce the amount of manual adjustments thatneed to be
    made. I can stress this enough. We can even help you write theregular
    expression rules if you simply identify the code pattern you wish to
    convert. Just because there is not already a regular expressionrule to
    match your need does not mean it can't be written. We have notnearly
    exhausted the possibilities.
    For example if you say, we need to convert
    CSpider.getDataObject("X");
    To
    RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
    Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
    updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
    rule:
    <!--getPage to getViewBean-->
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getViewBean($1ViewBean.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    Following this example a getDataObject to getModel would look
    like this:
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getModel($1Model.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    In fact, one migration developer already wrote that rule andsubmitted it
    for inclusion in the basic set. I will post another upgrade to thebasic
    regular expression rule set, look for a "file uploaded" posting.Also,
    please consider contributing any additional generic rules that youhave
    written for inclusion in the basic set.
    Please not, that in some cases (Utility classes in particular)
    the rule
    application may be more effective as TWO sequention rules ratherthan one
    monolithic rule. Again using the example above, it will convert
    CSpider.getDataObject("Foo");
    To
    getModel(FooModel.class);
    Now that is the most effective conversion for that code if that
    code is in
    a page or data object class file. But if that code is in a Utilityclass you
    really want:
    >
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    So to go from
    getModel(FooModel.class);
    To
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    You would apply a second rule AND you would ONLY run this rule
    against
    your utility classes so that you would not otherwise affect yourViewBean
    and Model classes which are completely fine with the simplegetModel call.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getModel\(]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getModel\(]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    A similer rule can be applied to getSession and other CSpider APIcalls.
    For instance here is the rule for converting getSession calls toleverage
    the RequestManager.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getSession().]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    ----- Original Message -----
    From: "Matthew Stevens" <matthew.stevens@e...>
    Sent: Tuesday, August 07, 2001 12:56 PM
    Subject: RE: [iPlanet-JATO] Use Of models in utility classes
    Namburi,
    I will post a document to the group site this evening which has
    the
    details
    on various tactics of migrating these type of utilities.
    Essentially,
    you
    either need to convert these utilities to Models themselves or
    keep the
    utilities as is and simply use the
    RequestManager.getRequestContext.getModelManager().getModel()
    to statically access Models.
    For CSpSelect.executeImmediate() I have an example of customhelper
    method
    as a replacement whicch uses JDBC results instead of
    CSpDBResult.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
    Sent: Tuesday, August 07, 2001 3:24 PM
    Subject: [iPlanet-JATO] Use Of models in utility classes
    Hi All,
    In the present ND project we have lots of utility classes.
    These
    classes in diffrent directory. Not part of nd pages.
    In these classes we access the dataobjects and do themanipulations.
    So we access dataobjects directly like
    CSpider.getDataObject("do....");
    and then execute it.
    Since the migration tool does not do much of conversion forthese
    utilities we have to do manually.
    My question is Can we access the the models in the postmigration
    sameway or do we need requestContext?
    We have lots of utility classes which are DataObjectintensive. Can
    someone suggest a better way to migrate this kind of code.
    Thanks
    Namburi
    [email protected]
    [email protected]
    [Non-text portions of this message have been removed]
    [email protected]
    [email protected]

  • Utility Classes in EAR

    Hello,
    Can someone tell me where I should put utility classes in an .ear file when
    they are being used by both the EJBs (in the .jar file) and the web app (in
    the .war file). I tried just putting them in the root of the .ear file but
    WL 6.0 still couldn't find them. Is there such thing as META-INF/lib?
    Thanks in advance,
    Rob Lewis

    I remember that somebody else reported this problem - when the utility classes are
    in the ejb-jar servlets do work, but JSPs fail to compile - that sounded like a WLS bug.
    Here is the description of 6.0 classloading:
    http://e-docs.bea.com/wls/docs60/programming/topics.html#1037589
    Rob Lewis <[email protected]> wrote:
    This doesn't appear to be the case. I have an EAR with a JAR and WAR in it.
    I removed the utility classes from the WAR that were repeated in the JAR.
    Then the JSPs failed to find those classes. JBoss lets you put utility
    classes in a JAR in the EAR and then set 'Class-Path' in the manifest.mf to
    point to it but this also didn't work for me in WL6.
    I'm at a loss.
    Rob
    "Cameron Purdy" <[email protected]> wrote in message
    news:[email protected]..
    I think you can put them in either the JAR or the WAR and it willwork --
    wl6 seems to use a single classloader for the entire ear.
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com
    +1.617.623.5782
    WebLogic Consulting Available
    "Rob Lewis" <[email protected]> wrote in message
    news:[email protected]..
    Hello,
    Can someone tell me where I should put utility classes in an .ear filewhen
    they are being used by both the EJBs (in the .jar file) and the web app(in
    the .war file). I tried just putting them in the root of the .ear filebut
    WL 6.0 still couldn't find them. Is there such thing as META-INF/lib?
    Thanks in advance,
    Rob Lewis
    Dimitri

Maybe you are looking for