Oliver Ng

Greenhorn
+ Follow
since Aug 28, 2001
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 Oliver Ng

you've totally lost me there, could you clarify please?
Using StAX, I'm trying to write a small progress meter so I know how far along in parsing the XML file I am. (ie 50% of 100% file complete)

In the location class, there is Location.getCharacterOffset() which is supposed to return either a byte or character position. It seems to be returning a character position, and I dont know how to make it return in bytes.

Does anyone know how I can do this? or does anyone know how I could get the total characters in a file without reading through the whole file?

Its a 100 mb file, so I'm trying to be efficient here.

Thanks a lot for any input, or ideas


[ March 19, 2005: Message edited by: Oliver Ng ]
i solved this problema long time ago but for anyone wondering...

I was using jstl Cout message tags, and there is an attribute escapeXml=true

also, for bean:Write messages, there is a filter=false attribute to not convert the html to text automatically
[ August 30, 2004: Message edited by: Oliver Ng ]
19 years ago
Forgive me if this sounds stupid, but how do I put a new line in a properties file for the Struts <html:messages> to read them? They always seem to output with my HTML code.

ie
error.welcomeerrror=Welcome<BR> to my error

will output the <BR> instead of reading it as html.

any help appreciated.

Thanks
19 years ago
OK, i've finally managed a way to do it



this actually seems to work as it overwrites the HEADER attribute in the definition, based on what my action wants to do.

I've run into another problem though. Is there a way to forward to an external URL? when i use

it gives forwards the address as http://localhost/MYAPPNAME/http://lcaolhost/ssi/header.jsp

how can i get around this automatic appending of my application root path?

Thanks for your input so far.
[ June 28, 2004: Message edited by: Oliver Ng ]
19 years ago
actually, i'm getting close but not quite there yet.

I'm using

to create an action that puts the needed attributes into the tiles:insert html tag, but i've run into an issue that i'm baffled with.

I can't seem to get the insert tag to read the attribute given to it by my controller action, instead it seem to read the header value right away.

maybe what i'm doing is wrong but somehow i feel like i'm on kind of the right track? anybody?
19 years ago
Hi all,

I did a search and didn't find any information so, here is my quesiton:

I'm using a tiles definition xml, and I would like to have a header be dynamically picked based on what information is taken from a database.

Now I realize, i could, technically do whatever processing I need to in a JSP, but I'd like to use a Struts Action to determine what header file to include. My current XML is this:


now I was wondering if it's acceptable to do this in the "header" value:


is this possible? and how would I be able to pass a different value URL to the header "put" definition?

thanks for any or all help
Cheers,
Oliver
19 years ago
Hello,
Say I have two pages
index.jsp
indexprocess.jsp
is there a way using jsp requests/responses where i can validate that the request being submitted to indexprocess.jsp isn't some sort of malicious page?
I've read somewhere that you can validate where the page is coming from to make sure it's server side using ASP, and i was curious if this is possible for JSPs.
I'm trying to secure the form as muhc as possible.
Thanks for taking the time to reply.
20 years ago
JSP
thanks for all your replies.. i will try these out and see if it leads to a solution
I have a query that says:
String query = "SELECT count(*) as NUM_ORDERS " +"FROM web_order_header " +"WHERE CREATE_DATE >= '" + date1.trim() + "' AND CREATE_DATE <= '" + date2.trim() + "'";
where dates are in the format 01-jan-2003
when i try to run the statment through a stmt.executeQuery(query), i get an error saying
java.sql.SQLException: ORA-01858: a non-numeric character was found where a numeric was expected
can someone please tell me what is wrong with this SQL statement? It seems to work fine using SQLNavigator... i'm really stuck
Hi,
i was wondering if anyone had opininos on paging resultsets and if its more beneficial to query the database upon each page reload, or store a resultset in a sessionvariable and merely reference that. This is for a search type page (imagine google).
i can imaging storing a reference variable to be a very wasteful operation, and how would i be able to track if a user isn't using the sessionvariable anymore?
i can also see a DB connection being a problem itself as it would involve many many connections to the database.
so which would you choose and/or recommend?
i've read this post and am interested in how this method would work:


mveitas
Member # 17216
posted July 18, 2001 10:53
Another approach, although more compilcated is to store the ResultSet and therefore you will have access to the cursor behind the scenes. We have implemented this successfully, storing the connection, statement, and result set in the user session. When the user closes the browser we use javascript to catch this and send a POST request to our servlet to clean up the db connection info associated with this "query".
On a side note, you might want to play with the fetch size to get optimal throughput on your system.
Matt


[ May 12, 2003: Message edited by: Oliver Ng ]
20 years ago
JSP
my apologies i'm so dumb... there is an example right in the JTree API...
thank you for the help though..
Oliver
21 years ago
Hello,
I have a simple JTree and i wish for a new window to popup when I double click on a node in the tree. Could someone please aid me in learning how this could be done? All help is greatly appreciated.
The result would look much like say, a contact list for ICQ, where the nodes are the groups, and the leafs are the contacts. Like ICQ, i want a box to popup on doubleclick (and only a double click) for the selected Jtree leaf.
I registered a mouseListener and tree selection listener but there doesn't seem to be any type of listener for double clicks on tree elements.
Thanks
Oliver
21 years ago
I just like the ability to type
cd progr*
and it will take me to program files. Plus the rightclick cut and paste method and the instant doskey. Also how you can browse directories by only typing in a bit and pressing tab.
Its also useful to title the dos windows when i have 10 open.
22 years ago
Hello,
I was curious to know if there are any programs out there that can simulate the windows 2000 commandpromt for windows 98. I dont want to switch to 2000 (for compatibility reasons) but I really enjoy the W2K CmdPrompt.
Is there a program that will do this for me? or better yet is there a way to use the Win2K prompt with Windows98?
Thanks for your time.
Oliver
22 years ago