Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!

Eoin Mac Aoidh

Ranch Hand
+ Follow
since May 19, 2005
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 Eoin Mac Aoidh

I am trying to make a very basic portlet where 1 jsp page links to another. Nothing more. I create a war file and deploy in liferay. The portlet displays fine. The problem is that the pages I try to link to can not be found. For example,
When the portlet loads, page1.jsp is displayed. It contains the code:

page1.jsp and page2.jsp are both located in the same place, the WebContent folder.

When I click on the link which I expect will load page1 in the portlet, I get the error:

The requested resource was not found: http://xxx.xxx.x.xx/web/guest/page2.jsp

My portlet.xml file to initialize the portlet contains the code:

As page1 and page2 are both in the same directory, I am puzzled why page2 can not be found.
Perhaps there is some directory or context structure I should be specifying in the portlet.xml file?

Any help greatly appreciated.
Thanks
e
8 years ago
In Eclipse
From the menu, Window >preferences>run/debug>console...make your choice!

Eoin
8 years ago
Hi all, Im looking for a bit of advice on how to proceed here.
I have just taken up the reins on a project which has a whole pile of code written, but not a single piece of documentation or single comment produced
It uses Spring, and JSP, both of which are new to me, bundles everything up into a War file, and then I need to deploy it as a portlet through a cms.
The main functionality I need to edit is for users to upload an xl file, then the application extracts the data and puts it into a database.
I need to do things like add more columns to the files, change the Db structure etc.
The biggest problem as I see it is figuring out what all the existing code actually does. The way the environment is setup to bundle as a war and deploy as a portlet, I dont have the opportunity to riddle it with system.out.printlns to figure the code out and make the required changes.
Would it be a viable option to start with something simpler, e.g the java.csv library. And just build a simple java application to extract the info from csv files, connect to the db and insert. Then I could convert this say to an applet and deploy it within the csv. This would provide all the functionality I would need for now.

Any thoughts or opinions greatly appreciated.
Thanks,
Eoin.
8 years ago
I had this problem before, I cant remember the exact solution, but it was something to do with the path variables. You are looking in the right place! Make sure you dont have a duplicate entry. For instance a path to version 1.5 in the PATH variable, but also a ref to a variable such as JAVA_HOME which might be set to an older java version.

If you dont need the older version, Id search for it and make sure to remove it entirely from your system, that way you can be sure its gone.

Hope that points you in the right direction.
Hi,
I have been successfully connecting to a remotely hosted Oracle DB for some time using the code below. However, my local circumstances have changed now, in that I must now make all my connections through a proxy. I cannot figure out how to update my code to connect to the DB through the proxy so that the connection will be allowed. Im convinced its something very simple like just adding a proxy variable to the connection code, but I cant get it right! Any help on this greatly appreciated.
Thanks,

E

Hi, I am wondering if it is possible to open a url from a java application in the most recent browser tab, i.e without spawning a new tab to show the specified page.
I have done a bit of searching on this topic, and the command

is the usual suggestion. This opens a particular URL, but it opens it in a new tab. Is it possible to override the new tab command?
Thanks,

Eoin.
9 years ago
Hi all,
I am having a bit of trouble making a window that will provide scroll capabilities and contain a JPanel.
My code works fine for creating a window to provide scroll capabilities for a JLabel that is too big for the window (Just not for a panel, and I cant figure out why!!!)

Heres what Ive got:



Is it just not possible to do this for a panel?
I would be delighted with any pointers.
Many thanks,

Eoin.
10 years ago
Hi Nikhill,
There is probably a much nicer way of doing it, but the simplest approach for me would be to parse the original xml file, extracting the information you require and placing it in a queue ADT like a linked list or similar structure. Then create a new file and write the information from the queue, element by element to the new file.
Hope that helps,

Eoin.
Thanks for the pointer Ulf.

E
10 years ago
Hi,
I would like to be able to show a video from my applet.
I am running my applet on a pocket pc. All I want to do is give a link in some html where you say
How will it know what application to launch the video in?

When testing the html code above in Internet Explorer it launches the appropriate programme and shows the video. Unfortunately from the html in my applet it acknowledges that it is a link(underlines it in blue), but nothing happens when I click on it.


Thanks.

Eoin.
10 years ago
Ps: My code dosnt actually contain smileys!
they are supposed to be
'colon'openLeftMonitor...
and
'colon'document.write....



E
11 years ago
Hi all,

I am having a problem calling two separate javascript functions from an applet at the same time.
I can call them both separately, but not together.
My applet should take some arguments in from an applet (as a string), then create a html page from the string and display it in a separate window.

The first function is to open a page in a new window:


The function is defined in a .js file

This works fine where mainpage.htm exists in the same directory which the applet is running from.

The second function is to create a html page from a string:


This successfully creates and displays a page from a string.
There is also a second, alternative function to do the same thing:

This also successfully creates and displays a page from a string.

Now I need to open the page created from the string in a new window by combining the functions. I have tried lots of things here such as:


but nothing seems to work.
If anyone has an idea how to combine two javascript functions like this it would be a big help.


Thanks.


Eoin.
[ July 20, 2007: Message edited by: Eoin Mac Aoidh ]
11 years ago
Thanks again Ulf.
I was trying to use the getCodeBase method, running on a webserver and I was also trying to create the file on the server, not the client but I guess thats just not possible...
Ive worked around it though and created a file on the client. Its not quite what I wanted, but it will do! thanks for your pointers.

Eoin.
11 years ago
Thanks Ulf,
I dont think its a security problem, the applet is signed. It seems to be something else.
Thamks for the I/O exception tip. - Ill work on that. I just threw the try/catch clause together quickly for the sake of creating a coherent post.

Eoin
11 years ago
I am trying to create a html page based on data I obtain from an applet, and store this page on the server, where the applet is running from. It works when I test it locally on my own machine, but when I try it live, online, it dosnt seem to create the page.

The (edited) code I use to create the page is as follows:


The execution of the code dosnt seem to go into the try. It just stops there.
I set all the permissions on the folders required to #777
Perhaps its not possible to use a buffered writer in this manner?
Ive been trying a few things with URI references instead of file objects but Im not having much luck there.

Any help greatly appreciated.
Thank you,

Eoin.
[ July 04, 2007: Message edited by: Eoin Mac Aoidh ]
11 years ago