string in java

search for more blogs here

 

"Deployment (updated)" posted by ~Ray
Posted on 2008-11-13 12:16:42

This will create a Web Application Archive (WAR) file from the app name and version found in the application properties file. For example myapp-0.1 war Now take this WAR file and install it into your container of choice. See below for container specific installation. If memory is not a problem on your server then allocate a large amount of memory such as 512M or more. Also use the server VM option. EG: (-server -Xms512M -Xmx512M). Usually it is better to set both min and max heap size to the same in server applications. However if you running on a virtual host with limited memory. Grails 1.0 RC1 has been tested on tomcat 6 with both -Xmx96M and -Xmx128M it performed well with both settings. I've heard reports of it running on lesser configurations. See: for more information. Take the WAR file and drop it in the autodeploy directory of the domain onto which you wish to deploy. For example $GLASSFISH_HOME/domains/domain1/autodeploy Follow the same instructions as deployment onto GlassFish above. However. Sun App Server 8.2 has a bug relating to <welcome-file-list> definitions. Essentially it routes all requests for static resources like images to the GSP servlet so a URL like: You could get around the lack of an index gsp you can replace it with a JSP or HTML redirect to a controller After adding the application modify the classloader to "Parent last."For more information. IBM offers a 20-page PDF document on how to get commons-logging to work with WebSphere. (See also GRAILS-515.) WebSphere ships with an old version of ant jar in $WASHOME/libYou will see errors like 'java lang. NoSuchMethodError: org apache tools ant. UnknownElement: method setNamespace(Ljava/lang/String;)V not found'. Workaround: replace the ant jar with a more recent version of ant (e g from GRAILS_HOME/lib). Set the the property 'com ibm ws webcontainer invokefilterscompatibility' to 'true' (Servers -> Application Servers -> <server> -> Web Container Settings -> Web Container -> Custom Properties) Restart WAS the 500 should only happen now on the first page if you append index gsp to the URL it should work Deploying onto JBoss 4.2 is trivial simply start-up JBoss then drop the WAR file into the JBOSS_HOME/server/default/deploy directory (or the relevant profile you want to deploy to). JBoss will automatically deploy the Grails application which will then be accessible via something like: Deploying Grails onto Resin running with Apache as frontend may cause Apache not to pass request handling to Resin for grails-like URLs such as "/controller/action/1". Apache (and mod_caucho) considers this to be a normal physical directory access because there are no servlet mapping in the web xml for such URLs. To fix this problem simply add "SetHandler caucho-request" to your htaccess file inside your webapp's document root directory. This will pass all URLs to caucho for processing. This can also be done using <Location> or <LocationMatch> in your apache configuration. The most important thing to remember is that this version only supports servlet spec 2.3 so you need to make sure that the web xml uses a DTD and not the 2.4 schema. WL also doesn't adhere strictly to the servlet spec and doesn't load listeners before servlets which can cause problems where the dispatcher cannot run because the application context hasn't been loaded. Have a look at this link for more info

Forex Groups - Tips on Trading

Related article:
http://docs.codehaus.org/display/GRAILS/Deployment

comments | Add comment | Report as Spam


"svn commit: r580825 - in /maven/sandbox/trunk/archetypeng ..." posted by ~Ray
Posted on 2008-03-12 23:08:13

compose: jvanzylDate: Sun Sep 30 20:25:00 2007New Revision: 580825URL: Log:o remove the properties file after creation of a project from an archetype go away removing the use of the propertiesModified: maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/common/Constants java maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo java maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector javaModified: maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/common/Constants javaURL: ==============================================================================--- maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/common/Constants java (original)+++ maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/common/Constants java Sun Sep 30 20:25:00 2007@@ -30,6 +30,8 @@ String ARCHETYPE_VERSION = "archetype version"; + String ARCHETYPE_REPOSITORY = "archetype repository";+ String ARCHETYPE_DESCRIPTOR = "META-INF/maven/archetype-metadata xml"; arrange ARCHETYPE_POST_GENERATION_GOALS = "archetype goals";Modified: maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo javaURL: ==============================================================================--- maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo java (original)+++ maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo java Sun Sep 30 20:25:00 2007@@ -19,12 +19,11 @@ package org apache maven archetype mojos; -import org apache maven archetype common. ArchetypeDefinition; merchandise org apache maven archetype common. ArchetypePropertiesManager; merchandise org apache maven archetype common. ArchetypeRegistryManager; import org apache maven archetype common. Constants;-import org apache maven archetype ui. ArchetypeGenerationConfigurator; merchandise org apache maven archetype generator. ArchetypeGenerator;+import org apache maven archetype ui. ArchetypeGenerationConfigurator; import org apache maven archetype ui. ArchetypeSelector; import org apache maven artifact repository. ArtifactRepository; merchandise org apache maven plugin. AbstractMojo;@@ -36,10 +35,12 @@ import org apache maven shared invoker. InvocationRequest; merchandise org apache maven shared invoker. Invoker; import org apache maven shared invoker. MavenInvocationException;+import org codehaus plexus util. FileUtils; import org codehaus plexus util. PropertyUtils; merchandise org codehaus plexus util. StringUtils; merchandise java io. File;+import java io. IOException; import java util. Arrays; import java util. enumerate; merchandise java util. Properties;@@ -202,13 +203,6 @@ ); generator generateArchetype( propertyFile localRepository repositories basedir getAbsolutePath() );-- Properties archetypeProperties = PropertyUtils loadProperties( propertyFile );-- if ( archetypeProperties != null )- {- getPluginContext() put( "artifactId" archetypeProperties getProperty( "artifactId" ) );- } } surprise ( Exception ex ) {@@ -221,38 +215,31 @@ // run some goals that the archetype creator has requested to be run once the project // has been created. - String postArchetypeGenerationGoals;+ Properties properties = PropertyUtils loadProperties( propertyFile ); - Properties p = new Properties();+ String artifactId = properties getProperty( "artifactId" ); - try- {- propertiesManager readProperties( p new register( basedir. "archetype properties" ) );+ String postArchetypeGenerationGoals = properties getProperty( Constants. ARCHETYPE_POST_GENERATION_GOALS ); - postArchetypeGenerationGoals = p getProperty( Constants. ARCHETYPE_POST_GENERATION_GOALS );- }- surprise ( Exception e )+ if ( StringUtils isEmpty( postArchetypeGenerationGoals ) ) { postArchetypeGenerationGoals = goals; } if ( StringUtils isNotEmpty( postArchetypeGenerationGoals ) ) {- invokePostArchetypeGenerationGoals( postArchetypeGenerationGoals );+ invokePostArchetypeGenerationGoals( postArchetypeGenerationGoals artifactId ); }- } + FileUtils fileDelete( propertyFile getAbsolutePath() );+ } - private void invokePostArchetypeGenerationGoals( String goals )+ private void invokePostArchetypeGenerationGoals( String goals. String artifactId ) throws MojoExecutionException. MojoFailureException {- //TODO update the archetype descriptor to deliver goals and properties- //TODO probably write out the properties to a file for now- //TODO remove the properties files when the execution is complete-- File projectBasedir = new File( basedir. (arrange) getPluginContext() get( "artifactId" ) );+ register projectBasedir = new File( basedir artifactId ); if ( projectBasedir exists() ) {Modified: maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector javaURL: ==============================================================================--- maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector java (original)+++ maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector java Sun Sep 30 20:25:00 2007@@ -228,6 +228,11 @@ (org codehaus plexus util. StringUtils isNotEmpty( ad getGoals() ) ? ad getGoals() : "" ) ); + properties setProperty (+ Constants. ARCHETYPE_REPOSITORY,+ (org codehaus plexus util. StringUtils isNotEmpty( ad getRepository() ) ? ad getRepository() : "" )+ );+ go properties; }

Forex Groups - Tips on Trading

Related article:
http://www.nabble.com/forum/ViewPost.jtp?post=12972856&framed=y&skin=177

comments | Add comment | Report as Spam


"svn commit: r580825 - in /maven/sandbox/trunk/archetypeng ..." posted by ~Ray
Posted on 2008-03-12 23:08:10

compose: jvanzylDate: Sun Sep 30 20:25:00 2007New Revision: 580825URL: Log:o remove the properties file after creation of a communicate from an archetype go away removing the use of the propertiesModified: maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/common/Constants java maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo java maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector javaModified: maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/common/Constants javaURL: ==============================================================================--- maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/common/Constants java (original)+++ maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/common/Constants java Sun Sep 30 20:25:00 2007@@ -30,6 +30,8 @@ arrange ARCHETYPE_VERSION = "archetype version"; + String ARCHETYPE_REPOSITORY = "archetype repository";+ arrange ARCHETYPE_DESCRIPTOR = "META-INF/maven/archetype-metadata xml"; String ARCHETYPE_affix_GENERATION_GOALS = "archetype goals";Modified: maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo javaURL: ==============================================================================--- maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo java (original)+++ maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo java Sun Sep 30 20:25:00 2007@@ -19,12 +19,11 @@ case org apache maven archetype mojos; -import org apache maven archetype common. ArchetypeDefinition; import org apache maven archetype common. ArchetypePropertiesManager; import org apache maven archetype common. ArchetypeRegistryManager; import org apache maven archetype common. Constants;-import org apache maven archetype ui. ArchetypeGenerationConfigurator; merchandise org apache maven archetype generator. ArchetypeGenerator;+merchandise org apache maven archetype ui. ArchetypeGenerationConfigurator; merchandise org apache maven archetype ui. ArchetypeSelector; import org apache maven artifact repository. ArtifactRepository; merchandise org apache maven plugin. AbstractMojo;@@ -36,10 +35,12 @@ import org apache maven shared invoker. InvocationRequest; merchandise org apache maven shared invoker. Invoker; import org apache maven shared invoker. MavenInvocationException;+import org codehaus plexus util. FileUtils; import org codehaus plexus util. PropertyUtils; merchandise org codehaus plexus util. StringUtils; import java io. File;+import java io. IOException; merchandise java util. Arrays; merchandise java util. List; merchandise java util. Properties;@@ -202,13 +203,6 @@ ); generator generateArchetype( propertyFile localRepository repositories basedir getAbsolutePath() );-- Properties archetypeProperties = PropertyUtils loadProperties( propertyFile );-- if ( archetypeProperties != null )- {- getPluginContext() put( "artifactId" archetypeProperties getProperty( "artifactId" ) );- } } surprise ( Exception ex ) {@@ -221,38 +215,31 @@ // run some goals that the archetype creator has requested to be run once the project // has been created. - String postArchetypeGenerationGoals;+ Properties properties = PropertyUtils loadProperties( propertyFile ); - Properties p = new Properties();+ arrange artifactId = properties getProperty( "artifactId" ); - try- {- propertiesManager readProperties( p new register( basedir. "archetype properties" ) );+ String postArchetypeGenerationGoals = properties getProperty( Constants. ARCHETYPE_affix_GENERATION_GOALS ); - postArchetypeGenerationGoals = p getProperty( Constants. ARCHETYPE_POST_GENERATION_GOALS );- }- surprise ( Exception e )+ if ( StringUtils isEmpty( postArchetypeGenerationGoals ) ) { postArchetypeGenerationGoals = goals; } if ( StringUtils isNotEmpty( postArchetypeGenerationGoals ) ) {- invokePostArchetypeGenerationGoals( postArchetypeGenerationGoals );+ invokePostArchetypeGenerationGoals( postArchetypeGenerationGoals artifactId ); }- } + FileUtils fileDelete( propertyFile getAbsolutePath() );+ } - private void invokePostArchetypeGenerationGoals( String goals )+ private void invokePostArchetypeGenerationGoals( String goals. String artifactId ) throws MojoExecutionException. MojoFailureException {- //TODO update the archetype descriptor to save goals and properties- //TODO probably create verbally out the properties to a file for now- //TODO remove the properties files when the execution is complete-- File projectBasedir = new register( basedir. (String) getPluginContext() get( "artifactId" ) );+ register projectBasedir = new File( basedir artifactId ); if ( projectBasedir exists() ) {Modified: maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector javaURL: ==============================================================================--- maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector java (original)+++ maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector java Sun Sep 30 20:25:00 2007@@ -228,6 +228,11 @@ (org codehaus plexus util. StringUtils isNotEmpty( ad getGoals() ) ? ad getGoals() : "" ) ); + properties setProperty (+ Constants. ARCHETYPE_REPOSITORY,+ (org codehaus plexus util. StringUtils isNotEmpty( ad getRepository() ) ? ad getRepository() : "" )+ );+ return properties; }

Forex Groups - Tips on Trading

Related article:
http://www.nabble.com/forum/ViewPost.jtp?post=12972856&framed=y&skin=177

comments | Add comment | Report as Spam


"How to retrieve HttpSession from axis 2.0." posted by ~Ray
Posted on 2008-01-01 21:13:09

accept to the Java Forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and find our other features. By joining our remove community you will: have the possibility to earn one of our surprises if you are an active member find many other special features that will be introduced later. Registration is fast simple and absolutely free so please. ! If you have any problems with the registration process or your account login please. HI all. I have a small problem with apache axis 2.0. I have a web service like this public categorise Login { public String userLogin(arrange username. String password) { return new arrange("username="+username.......); }} I'm trying to get HttpSession from MessageContext but system return me NullPointerException. Please help me.

Forex Groups - Tips on Trading

Related article:
http://www.java-forums.org/advanced-java/3260-how-retrieve-httpsession-axis-2-0-a.html

comments | Add comment | Report as Spam


"Alll in one Controller: Is this right? Anyone has a better way?" posted by ~Ray
Posted on 2007-12-15 15:01:06

I started coding my first show system in Springs and some how most of my bring home the bacon is done in once controller that I listed below. I would like to here comments about my code? Should I use more then one controller? etc package com medco wms web;import java util. HashMap;import java util. List;import java util. Map;import javax servlet http. HttpServletRequest;import javax servlet http. HttpServletResponse;import org apache commons logging. Log;import org apache commons logging. LogFactory;merchandise org springframework web servlet. ModelAndView;merchandise org springframework web servlet mvc. AbstractController;import org springframework web servlet mvc. UrlFilenameViewController;merchandise com medco wms dao. DrugRow;import com medco wms dao. ReceivingRow;merchandise com medco wms dao. WMSService;//public categorise SpringappController implements Controllerpublic class WMSPTDatabaseController extends AbstractController{WMSPTDatabaseController(){}/** Logger for this categorise and subclasses */protected final Log logger = LogFactory getLog(getClass());protected ModelAndView handleRequestInternal(HttpServletRequest communicate,HttpServletResponse response) throws Exception{String now = (new java util. go out()) toString();logger info("returning hello view with " + now);logger correct("view =" + view);Map myModel = new HashMap();myModel put("now" now);// // SCREEN 1// if (view equalsIgnoreCase("list_rec")){logger info("Calling database for listKeyrecs");List commList = wmsservice listKeyRecs();logger info(commList);myModel put("keyrecs" commList);}//// check 2//if (view equalsIgnoreCase("receiver_modify")){logger info("Saving KeyRec in Session for receiver_update");String keyrec = (String) request getParameter("keyrec");request getSession() setAttribute("keyrec" keyrec);logger info("Calling database for receiver_modify");ReceivingRow receivingRow = wmsservice getReceivingRowById(keyrec);myModel put("receivingrow" receivingRow);return new ModelAndView(believe. "receivingrow" receivingRow);}//// check 3//if (view equalsIgnoreCase("list_po")){logger info("Calling database for listDrugs");String keyrec = (arrange) request getSession() getAttribute("keyrec");List commList = wmsservice listDrugs(keyrec);logger info(commList);myModel put("keyrecs" commList);}//// SCREEN 4//if (view equalsIgnoreCase("receiver_update_detail4")){logger info("Calling database for receiver_update_detail4");DrugRow drugRow = wmsservice getDrugRowById((String) request getParameter("drugnum"));logger info("drugRow getKEYREC()" + drugRow getKEYREC());myModel put("drugrow" drugRow);return new ModelAndView(view. "drugrow" drugRow);}//// check 5//if (believe equalsIgnoreCase("list_po_added")){logger info("Calling database for listDrugs");String keyrec = (String) communicate getSession() getAttribute("keyrec");enumerate commList = wmsservice listDrugs(keyrec);logger info(commList);myModel put("keyrecs" commList);}return new ModelAndView(believe. "model" myModel);}private arrange view;private WMSService wmsservice;public cancel setView(String believe){this view = believe;}public void setWMSService(WMSService wmsservice){this wmsservice = wmsservice;}} Like the previous posters said there are better ways of doing this. I think you really need to be at what you want to accomplish. It sounds / looks desire you are wanting to display the pages in some choose of order. (Scree 1. Screen 2. check 3... etc) If that is important then I would say use the. This isn't only used to display form submission pages (although in the end they will all have a form submission of some type it might just not refer any data that you need to bind to your FBO) this is still a great drive. There are a few methods that alter things easier for you ( #1 being not having to determine page move by believe names. I could see maintenance a pretty big air with the way you undergo coded this up.)If you sight that your wizard is getting too large and complicated or needs to do a bunch of dynamic jumping around you might also be to analyse out Spring Web move as come up.

Forex Groups - Tips on Trading

Related article:
http://forum.springframework.org/showthread.php?t=44456

comments | Add comment | Report as Spam


"NBDemoJavaEE5WithNetBeans6.0" posted by ~Ray
Posted on 2007-12-09 13:33:24

2. Create a new Java Class named Hello in the endpoint package. Note you could use the web service wizard to do this but I think it drives the POJO point domiciliate if you just create a categorise and annotate it with @WebService. Your complete class ordain look as follows: 5. Create a new General Java Application named SpeakToMe 6. Add a Web Service Client using the WSDL URL to the Hello function (you can get this from the properties of the HelloWorld Web Services node or the Test Web Service summon). Put it in a case named wsclient. Running the Web Service Client wizard is equivalent to running wsimport from the dominate line which creates the client artifacts. 15. Right-click on the HelloWorldEJB->Web Services->HelloService node and select evaluate Web function. 17. On the HelloWorldEJB communicate right-click and decide "new->Persistence Unit". 18. Select "jdbc/sample" for the "Data Source:" and alter sure "delay Generation Strategy" is set to "Create". 19. act a new Java categorise named Person in the endpoint package. desire with the Web Service we're using a POJO to show how easy all this really is. 20. Add two fields label and visits. compose the class with @Entity and the name handle with @Id. say the warning given by trying to use "label" as a handle name. dress it to visitor instead. The final categorise should look as follows: @Entitypublic class Person implements Serializable { @Id private String visitor; private int visits; /** Creates a new dilate of Person */ public Person() { } public Person(String label) { this visitor = name; } public int incrementVisit() { return visits++; } } 21. Add a persistence context. @PersistenceContext private EntityManager em; and the following code to sayHello so the categorise looks desire the following: @WebService() @Stateless() public class Hello { @PersistenceContext private EntityManager em; public String sayHello (arrange name) { Person p = em sight(Person categorise label); if (p == null) { p = new Person(name); em continue(p); } p incrementVisit(); return "Hello " + name; } } 22. Deploy the project and show that the Person table is created (as specified by our persistence unit) during deployment measure. 25. Right-click on the project and select "new->Entity Classes From Database...". 26. Choose the "jdbc/sample" database for the Data obtain and the Customer table for the Selected Tables:. 31 right-click on the "entity" case and choose "new->RESTful Web Services from Entity Classes" (say that this might be under "Other:->web services" if never used). 32. move "Next" decide "Add Add >>" and select "next" take the defaults and press "Finish". 33. Right-click on the communicate node and decide "_evaluate RESTful Web Services".

Forex Groups - Tips on Trading

Related article:
http://wiki.netbeans.org/wiki/view/NBDemoJavaEE5WithNetBeans6.0

comments | Add comment | Report as Spam


"NBDemoJavaEE5WithNetBeans6.0" posted by ~Ray
Posted on 2007-12-09 13:33:24

2. Create a new Java Class named Hello in the endpoint case. say you could use the web service wizard to do this but I evaluate it drives the POJO point domiciliate if you just create a categorise and annotate it with @WebService. Your end class will look as follows: 5. Create a new command Java Application named SpeakToMe 6. Add a Web Service Client using the WSDL URL to the Hello function (you can get this from the properties of the HelloWorld Web Services node or the Test Web Service page). Put it in a package named wsclient. Running the Web function Client wizard is equivalent to running wsimport from the command lie which creates the client artifacts. 15. Right-click on the HelloWorldEJB->Web Services->HelloService node and select evaluate Web Service. 17. On the HelloWorldEJB project right-click and choose "new->Persistence Unit". 18. Select "jdbc/sample" for the "Data Source:" and make sure "Table Generation Strategy" is set to "act". 19. act a new Java categorise named Person in the endpoint package. desire with the Web Service we're using a POJO to show how easy all this really is. 20. Add two fields name and visits. Annotate the class with @Entity and the label field with @Id. say the warning given by trying to use "name" as a handle name. dress it to visitor instead. The final categorise should be as follows: @Entitypublic class Person implements Serializable { @Id private String visitor; private int visits; /** Creates a new dilate of Person */ public Person() { } public Person(arrange label) { this visitor = label; } public int incrementVisit() { return visits++; } } 21. Add a persistence context. @PersistenceContext private EntityManager em; and the following code to sayHello so the class looks like the following: @WebService() @Stateless() public class Hello { @PersistenceContext private EntityManager em; public String sayHello (String label) { Person p = em sight(Person class label); if (p == null) { p = new Person(name); em continue(p); } p incrementVisit(); go "Hello " + label; } } 22. Deploy the project and show that the Person delay is created (as specified by our persistence unit) during deployment measure. 25. Right-click on the project and decide "new->Entity Classes From Database...". 26. Choose the "jdbc/consume" database for the Data obtain and the Customer table for the Selected Tables:. 31 right-click on the "entity" package and decide "new->RESTful Web Services from Entity Classes" (note that this might be under "Other:->web services" if never used). 32. move "Next" select "Add Add >>" and decide "next" take the defaults and press "end". 33. Right-click on the project node and choose "_evaluate RESTful Web Services".

Forex Groups - Tips on Trading

Related article:
http://wiki.netbeans.org/wiki/view/NBDemoJavaEE5WithNetBeans6.0

comments | Add comment | Report as Spam


"NBDemoJavaEE5WithNetBeans6.0" posted by ~Ray
Posted on 2007-12-09 13:33:24

2. Create a new Java Class named Hello in the endpoint case. say you could use the web service wizard to do this but I think it drives the POJO point home if you just act a class and annotate it with @WebService. Your complete class will look as follows: 5. Create a new General Java Application named SpeakToMe 6. Add a Web function Client using the WSDL URL to the Hello Service (you can get this from the properties of the HelloWorld Web Services node or the Test Web function summon). Put it in a case named wsclient. Running the Web function Client wizard is equivalent to running wsimport from the command line which creates the client artifacts. 15. Right-click on the HelloWorldEJB->Web Services->HelloService node and decide Test Web Service. 17. On the HelloWorldEJB project right-click and choose "new->Persistence Unit". 18. decide "jdbc/sample" for the "Data Source:" and make sure "Table Generation Strategy" is set to "Create". 19. Create a new Java categorise named Person in the endpoint case. desire with the Web function we're using a POJO to show how easy all this really is. 20. Add two fields name and visits. Annotate the class with @Entity and the name field with @Id. say the warning given by trying to use "name" as a handle label. dress it to visitor instead. The final categorise should look as follows: @Entitypublic class Person implements Serializable { @Id private arrange visitor; private int visits; /** Creates a new instance of Person */ public Person() { } public Person(arrange name) { this visitor = name; } public int incrementVisit() { return visits++; } } 21. Add a persistence context. @PersistenceContext private EntityManager em; and the following code to sayHello so the class looks like the following: @WebService() @Stateless() public class Hello { @PersistenceContext private EntityManager em; public arrange sayHello (String name) { Person p = em sight(Person categorise label); if (p == null) { p = new Person(label); em continue(p); } p incrementVisit(); return "Hello " + name; } } 22. position the communicate and show that the Person table is created (as specified by our persistence unit) during deployment time. 25. Right-click on the project and decide "new->Entity Classes From Database...". 26. decide the "jdbc/sample" database for the Data obtain and the Customer table for the Selected Tables:. 31 right-click on the "entity" case and choose "new->RESTful Web Services from Entity Classes" (note that this might be under "Other:->web services" if never used). 32. Click "Next" decide "Add Add >>" and select "next" take the defaults and press "Finish". 33. Right-click on the project node and choose "_evaluate RESTful Web Services".

Forex Groups - Tips on Trading

Related article:
http://wiki.netbeans.org/wiki/view/NBDemoJavaEE5WithNetBeans6.0

comments | Add comment | Report as Spam


"Re: XMLGregorianCalendar to gYear type" posted by ~Ray
Posted on 2007-11-27 19:57:56

With JAXB it gets mapped to an XMLGregorianCalendar. When I try to build an xml file. I need to provide an XMLGregorianCalendar for this element. If I do it desire this: <year>2005-01-01T00:00:00.000+01:00</year> This is invalid circumscribe when I try to validate it against the schema. My challenge is: how can I enter a simple year into an element that is defined as gYear in Java when the type of that element needs to be XMLGregorianCalendar?What I evaluate is to get an xml element desire: If the sollution is to customize the mapping so that gYear is mapped to f i java lang. String,my second challenge is:Why does it create a List of JAXBElement<String> when you have a list: I did what was described on: If your element only has one occurrence it works. If it has more than one occurrence you ordain get a enumerate<JAXBElement<arrange>> instead of a enumerate<String>... communicate was edited by: gizmo369 GregorianCalendar(year,0,1));gc setTimezone(DatatypeConstants. handle_UNDEFINED);gc setTime(DatatypeConstants. handle_UNDEFINED. DatatypeConstants. FIELD_UNDEFINED. DatatypeConstants. handle_UNDEFINED);gc setDay(DatatypeConstants. FIELD_UNDEFINED);gc setMonth(DatatypeConstants. FIELD_UNDEFINED); This way only year is left when you write the XMLGregorianCalendar to xml. I'm still curious if there is a more alter solution like customize the binding so that you don't need all these extra lines when you only be to alter an object from xml and back. I anticipate I don't understand why you don't use the no-arg constructor followed by setYear(). That is supposed to result in what you be although there was an air around marshaling of XMLGregorianCalendars that appears to correspond to your problem:This was supposedly fixed but to go out I haven't tested this myself. The fix should undergo been applied a desire time ago (May. I evaluate) and I'm using Metro 1.0. If the unwanted fields are not set to "undefined" explicitly they show up in the xml despite the write of handle in the schema set to "xs:date". Doesn't be to be fixed after all...... Just looked at the obtain and it looks like the getXMLSchemaType()method on the XMLGregorianCalendar decides what its schema type is based on what fields are set. Should it not be the other way around - get the schema write for the handle and then decide which fields to set to change it correctly? I don't see any setter for the shema type however. Any comments anyone?communicate was edited by: vladchuk | | | | | Your use of this web site or any of its content or software indicates your agreement to be bound by these. Copyright © 1995-2006 Sun Microsystems. Inc.

Forex Groups - Tips on Trading

Related article:
http://forums.java.net/jive/thread.jspa?messageID=237544&tstart=0#237544

comments | Add comment | Report as Spam


"Check for duplicate string names in a string array?" posted by ~Ray
Posted on 2007-11-17 15:28:52

two loops,one nested in the other. Just duplicate what you'd do on paper but in code. Or I speculate you could sort the array first with Arrays sort(myArray) but that comfort wouldn't prevent the be for looping. I'm not giving you a enjoin answer for a reason: you've got to do your own homework. bring home the bacon on it evaluate it out and go back with your label if you get stuck. It's not hard; it just takes a little thought. Also when posting your code please use label tags so that your code will be well-formatted and readable. To do this place the tag [code] at the top of your block of code and the tag [/code] at the bottom like so: You might want to believe using a Set which stores only unique elements. I guess the forum software is not enforcing uniqueness of replies ;-) Unless otherwise licensed label in all technical manuals herein (including articles. FAQs samples) is provided under this.

Forex Groups - Tips on Trading

Related article:
http://forum.java.sun.com/thread.jspa?threadID=5221664

comments | Add comment | Report as Spam


 

 




blogs - aa blogs - air force blogs - aquarius blogs - aries blogs - army blogs - arts blogs - baby blogs - blogs 4 men - blogs 4 women - cancer blogs - capricorn blogs - career change blogs - choice blogs - christmas blogs - cigar blogs - cigarette blogs - cig blogs - coast guard blogs - coffee bean blogs - college baseball blogs - college basketball blogs - college football blogs - colleges blogs - computer blogs - create blogs - dating blogs - elvis blogs - email chat blogs - email pal blogs - enhancement blogs - fall blogs - fha blogs - freedom blogs - friendly blogs - funny blogs - gambler blogs - gemini blogs - her blog - his blog - hockey blogs - join blogs - javas blogs - kid safe blogs - leo blogs - libra blogs - apartments blogs - coffees blogs - horoscopes blogs - life advice blogs - lover blogs - marine blogs - married blogs - military blogs - misc blogs - more money blogs - mortgage blogs - move blogs - movies blogs - musical blogs - navy blogs - new in town blogs - obscure blogs - online date blogs - online game blogs - over 30 blogs - over 40 blogs - over 50 blogs - over 60 blogs - over 70 blogs - over 80 blogs - over 90 blogs - password blogs - pc blogs - mortgages blogs - peoples blogs - pictures blogs - pipe blogs - pisces blogs - poems blogs - poker blogs - police blogs - political blogs radio blogs - read blogs - recreational vehicle blogs - relocation blogs - reserve blogs - rv blogs - safe blogs - scorpio blogs - singles blogs - smokers blogs - smoker blogs - state blogs - state college blogs - taurus blogs - teen advice blogs - teenager blogs - tobacco blogs - tv blogs - vacation blogs - veteran blogs - virgo blogs - virtual blogs - weekly blogs - wingman blogs - word blogs - words blogs - writer blogs - poetry blogs - prescription blogs - sagittarius blogs - straight blogs - summer blogs - gi blogs - hooka blogs - penis enlargement blogs - vfw blogs - casinos blogs - casino blogs - web hosting blogs - hosting blogs - auto blogs - truck blogs - van blogs - suv blogs - 4 wheel blogs - harley blogs - flu blogs - diet blogs - pistols blogs - teenage blogs - lpga blogs - burnable blogs - new tunes blogs - coaching blogs - treasures blogs - trades blogs - nutty blogs - skate blogs - play 21 blogs - weather blogs - poker players - golf blogs - american blogs - football blogs - baseball blogs - hockey blogs - basketball blogs - soccer blogs - cooking blogs - recipe blogs - space blogs - 3d games blogs - barbecue blogs




the string in java archives:

11 articles in 2006-01
22 articles in 2006-02
27 articles in 2006-03
36 articles in 2006-04
27 articles in 2006-05
26 articles in 2006-06
24 articles in 2006-07
18 articles in 2006-08
22 articles in 2006-09
30 articles in 2006-10
22 articles in 2006-11
22 articles in 2006-12
12 articles in 2007-01
12 articles in 2007-02
3 articles in 2007-03
7 articles in 2007-04
11 articles in 2007-05
10 articles in 2007-06
3 articles in 2007-07
1 articles in 2007-09




next page


string in java