Patrick McDonogh

Ranch Hand
+ Follow
since Oct 13, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Patrick McDonogh

Hi ya all,

I am using Websphere MQ 5.3 and it only supports the old 1.0 version of JMS.

Does anyone know if there is a service pack or something that can be installed to enable it to support JMS version 1.1?

Thanks so much for any help.
14 years ago
Hi All,

I am trying to use JMS and have a couple of questions.

The first is that i can only find examples that use JNDI to get an instance of a ConnectionFactory which means that it would have to be managed elsewhere and stored in JNDI using a name and retrieved using that name.

Is it possible to rather programatically create a connection factory? If so, does anyone know of a code example or tutorial to do this?

Also, it is possible to do this using standard java with jar files or would you have to do it using an application server?

Thanks a lot for any advice or guidance. I know they are weird questions.
Hi All,

I am a Java developer and am looking at building a simple website, with pictures, content the admin user can change, users can post forms and send emails, timer tasks, etc.

Like I say its a simple website for a small building firm where users can get quotes and admin users change content and quote paramters for valuing a quote, update products and services.

I was wondering what people may recommend to build it. I know there are now things like ruby, jruby, groovy, etc.

Hopefully something that is quick and easy to use which comes with lots of functionality straight out the box!

Any suggestions?

Regards,

Patrick
15 years ago
PHP
Hi All,

I was wondering if anyone could shed some light on virtual servers on Glassfish and a Struts web application.

I have a web application called WebApp1 packaged in a war file i.e. WebApp1.war.

I have also configured a virtual host called www.webapp1.com

What i want to do is map the web domain name www.webapp1.com to my web application.

I create a virtual server called www.webapp1.com and set its default web application to WebApp1 and when i go to www.webapp1.com in a browser i can see its using the virtual server as i can see the web application( packaged in WebApp1.war).
But the url is re-written for instance index.jsp is re-written as as www.webapp1.com/WebApp1/index.jsp. Whereas before when i hosted this on tomcat it did what i expected i.e. www.webapp1.com/index.jsp.

So then i took WebApp1 off as the default web app for the virtual server on glassfish and then pointed its docroot to ${com.sun.aas.instanceRoot}/applications/j2ee-modules/WebApp1

I thought this would fix it but instead now when i go to www.webapp1.com i just get a directory listing of files.

Does anyone know how to get glassfish to configure virtual servers to a web app without having to set it as its default web app, so it doesnt put the web applications name ion the URL.

I.e. instead of www.webapp1/WebApp1/index.jsp it would be www.webapp1/index.jsp.

By the way if i go to www.webapp1/index.jsp the file still works as expected but any links in the page contain the WebApp1 i.e. www.webapp1/WebApp1/link1.jsp

Cheers,

Patrick
Hi All,

I thought that you had to use remote when the bean is running in a different JVM, but surly the bean and war file are running on the same JVM if deployed on the same server that is not clustered with any others?

Do you know of a tutorial that shows how to deploy a war and ejbs on separated files? I know i can do it when using JNDI but would rather use dependancy injection rather than explicit JNDI bean resource location.

Thanks for the help,

Patrick
Hi JavaRanchers,

I have an ebj class packaged in an ejb.jar file and a war file that has a servlet that calls the session bean in the ejb.jar file.
These are both packaged in an ear file. And i deploy the ear file to the application server which happens to be glassfish.

The servlet invokes the session bean as expected and everything works.

When i deploy the war and ejb.jar file separatelly(i.e. not in ear file) it doesnt work.

My question, is how do you deploy the ejb.jar file seraratelly to the war file and still enable the servlet in the war file get a reference to the bean.
I am using JEE5 and dependancy injection for the servlet to get a reference to the session bean. The session bean is also local not remote.

Does anyone know of a tutorial that shows how to deploy the beans separatelly from the war file.

Thanks,

Patrick
Hi There All,

I am trying to attatch a file to an email.

The trick is that the file does not exist on the file system. I have an InputStream which can read the file, as the file is stored as a blob in the database.

Does anyone know how to attatch a file to an email using an input stream.

I would prefer not to have to write the file to the file system and then create a File object from the file and then attatch this to the email as this would add additional overhead.

Cheers for any help guys and girls,

Patrick
16 years ago
Hi There,

I am running struts 1.3.5 on tomcat.

I have a form which takes a string and the form can then be submitted.

If a user has entered a � sign into the text box and submits the form it changes the � sign into A� this is really strange as � signs are not rendered correctly when the form is submitted.

I tested this on all forms on my site and it happens everywhere.

I think it is a strange character set thing?

Does anyone know how to fix this?

Cheers,

Patrick.
16 years ago
Does anyone know of another way to switch between http and https rather than using sslext?
16 years ago
Hi There All,

I apologise this is such a long problem but i dont know of another way to explain it.

I am having lots of problems getting SSLExt to work with Struts 1.3 and i am also using the tiles plugin.

I think the problem is that i am using tiles and have not configured something properly.

I followed the instructions at http://www.niallp.pwp.blueyonder.co.uk/sslext.html with how to do this but i am sure that i have to do something different when using tiles.

Does anyone know?

This is what i did.

I downloaded the struts13-sslext-command-1.0.jar as specified and added the org/nkp/struts13/sslext/sslext-chain-config.xml to the chainConfig in my web.xml

So it now reads
<init-param>
<param-name>chainConfig</param-name>
<param-value>
org/apache/struts/chain/chain-config.xml,org/nkp/struts13/sslext/sslext-chain-config.xml
</param-value>
</init-param>

I then modified my action-mappings elements as do:

<action-mappings type="org.apache.struts.config.SecureActionConfig">
...
</action-mappings>


I then configured the Secure Plugin in my struts-config.xml


<plug-in className="org.apache.struts.action.SecurePlugIn">
<set-property property="httpPort" value="8080"/>
<set-property property="httpsPort" value="8443"/>
<set-property property="enable" value="true"/>
<set-property property="addSession" value="true"/>
</plug-in>

I then added <set-property property="secure" value="true"/> to one of my actions that i want to be secure.

e.g.

<action path="/login" forward="login.page">
<set-property property="secure" value="true"/>
</action>


I then start tomcat (which is configured for use with ssl and tested and worked).

I then go to my application using just http on port 8080 and click on login which fires the /login action but it doesn't switch to ssl.
I was expecting is to switch and use port 8443 which is the correct ssl port on my tomcat server, but it doesnt change at all.

There are no errors on startup or anything.

I put a debugger in the SSLExtCommand class and the breakpoint is never hit, so this classes execute method is not being used.

Does anyone have any suggestions?

Please remember i am using struts 1.3.5 and also the tiles plugin to manage my pages.

Thank you for any help with this as its driving me crazy.

Cheers

Patrick
16 years ago
Thank you that worked perfectly
16 years ago
Hi there,

I have a struts web application(testing.war) running which is viewable over the internet.
Every now and again i want to update the application running.

Currently i shut down the tomcat server, overrite the old testing.war file in webapps with the new testing.war file and then re-start tomcat.

Now if someone visits the site(in IE) as tomcat is shut down they get a page saying:
The page cannot be displayed
The page you are looking for is currently unavailable,etc.

What i would like to do is make it so that the user is actually displayed a html page that i create saying the site is currently under maintenenace and please return in 20 minuites.
Does anyone know how to do this.

Thank you for any help.

Patrick
16 years ago
Hi all,

I have created a global exceptions xml element in my struts-config.xml file as follows.

<global-exceptions>
<exception key="exception.unknown" type="java.lang.Exception" path="/error.do"/>
</global-exceptions>

When exceptions are thrown in actions then the user is correctly shown the error page.

However, when an error is thrown in a JSP file or in the validate method of forms they are not taken to the error page!

Does anyone know how to send the user to the error page when errors are thrown in a JSP, or during form class reset and validate methods when using struts.

Best Regards,

Pat
16 years ago
Hi there everyone,

I have a struts web application and have some actions which i want to run every night for instance, every night run the action that searches the database for users who have been marked as deleted and remove them from the database.

I was wondering what the best(most performant) way is to run these actions that need to run at certain times of the day, month, year, etc. So i guess what i am asking is what the best was is to run tasks that need to run every day, year, etc at a certain time in Java.

Thanks for any help given.

Patrick
16 years ago