Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Martin Thorpe

Ranch Hand
+ Follow
since May 25, 2004
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 Martin Thorpe

Ok for anyone who might be interested it appears that I have fixed the problem, although I will have to monitor it over the next couple of days.

What I did in the end was to alter the connector in the Tomcat server.xml file:

so in tomcatRoot\conf\server.xml

I changed this line, which was the default Tomcat shipped with:


To be this


So specifying amount of threads and a connectionTimeout seems to sort it. Now it runs up to 16 - 25% when processing but drops straight back to 00 once finished as opposed to be constantly at 25%.

Hope it helps, I'll update if the problem re-occurs.

Thanks for reading
cheers
Martin
13 years ago
Hello I have a problem with Tomcat running at 25% CPU useage. I have identified from the web that this is probably a problem with the ISAPI connector, but have found no information on how to fix this.

I am running Tomcat 5.5.20 on IIS 5, on Windows 2000 server.

I am using the binary connector for windows I have tried 2 versions 1.2.14.0 and the latest 1.2.19.0 but I still have the problem.
Below is my workers file, I wonder if there is anything in here that might help


Any hints or tips that I might bring this under control would be gratefully appreciated. By the way on my development version, of the same application, there is no problem but this is running through port number direct to Tomcat and not over IIS.

cheers
Martin
13 years ago
Wahey Stefan, thats the doozy (don't know if I spelt that right probably as bad as my spelling of amendment ;-).

The thing is working as expected. Thank you very much for your in-depth help it is much appreciated. Is it always this difficult when you try to do something with Maps and EL?

Is there another way to deal with results of data in the JSP page, such as some kid of resultset output or something as opposed to a map?


Anyhoo, this is the implementation in the end.

The code in the servlet stayed the same as before casting the int of the frameworkID into a string to put into the map


And then in my JSP I am creating the string by using the c:set tag as you suggested


Stefan again thankyou very much I have certainly learnt a lot in this few day adventure outputting a grouped result. Thank you for sharing your time and your knowledge it really is much appreciated.

cheers
Martin
[ August 11, 2006: Message edited by: Martin Thorpe ]
14 years ago
JSP
OK well I got it working using plain old JSP but this kind of defeats the purpose of what I am trying to achieve. I just need to do the same thing as below with JSTL and not referencing the objects and their methods.

14 years ago
JSP
Ok I think I am getting close there are just a couple of things that I cannot crack, this should be so simple I can't believe it is now 2.5 days to get this working.

Anyway in my class I now have the following to create the map


In my JSP page I can access it like this:


This is all good and gets the value correctly but only proves that the data is actually in the map. What I now need to do is loop over the frameworks and get the ammendments relative to the frameworks. I can get values like this:


But that is incorrect as I am not looping over the specific ammendments related to the frameworks which produces holes in the data. So in theory I would need to do this (below) but this gives me no results at all from the ammendment loop, just blank.


I have run a test against the class itself and the map is populated correctly. What I think I am missing is the correct way to loop, or interrogate a Map. What could possibly make it work? Or what could be wrong?

Thanks for reading, have a nice day.

cheers
Martin
14 years ago
JSP
Excellent. Thank you both for your replies.

Stefan Evans thank you very much for your assistance I see what you mean and it makes sense to me thank you for explaining something so clearly. I will give that code a go.

cheers
Martin
14 years ago
JSP
Hello Bear.

Thanks for the reply.

What you describe is kind of my problem exactly. I have been requested to use Spring and Hibernate and am learning both through development of this project. I know what I need to acheive and whilst I am still at these early stages with learning I have decided upon a simple representation of the data from the database as a nested map which logically represents a grouped result to me.

So I have a map of frameworks and within the framework map I have an ammendment map, there is framework data in the framework map and ammendment data, related to the parent framework, in the ammendment map. This is now what I need to output.

So my question is how can I forEach over nested HashMaps?

You can see how I am placing the data into the hashmaps in my original post. I may well change the way that I get the data from the database in the future but for now I just need to get this up and running and HashMaps are the way for me.

P.S. is there anything in JSP || JSTL that will just dump the contents of a hashmap?

Thanks for reading.

cheers
Martin
14 years ago
JSP
Hello, just looking for a bit of advice on how I might approach this problem, which is a simple one but I just can't get it to work using Spring Hibernate and JSTL.

What I am trying to acheive is a group result output from 2 tables. Table Frameworks has a one to many with Ammendments.

Now what I want, on the same page, is this



I have tried to put all the frameworks and all the ammendments into 2 seperate hash maps in my controllers referenceData method and then use forEach in the JSTL to access them, with no success, like this (and in a variety of ways) with no success:


I also tried to nest the ammendment hashmap into the framework hashmap in my referenceData method like this: (but I don't know how to access this in the JSP page???)


This second way makes more sense to me as I am just using all my spring objects and methods. But how to get the result on the otherside???

Or maybe there is a simpler way with Hibernate?

Thanks for reading.

cheers
Martin

I
14 years ago
JSP
Excellent Mike thank you for posting your solution. I have the same setup and the exact same problem, the isELIgnored tags works a treat. Nice one.

cheers
Martin

Originally posted by Mike London:
The problem with my code was I needed a:

<%@ page isELIgnored="true" %>

at the top of the page.

The issues are these:

1) You are not allowed to use JSP scripting elements for "test". Ie the following is illegal:
<c:if test="<%= Math.random() < 0.5 %>">

2) You are using Tomcat 5 and a servlet 2.4 declaration in your web.xml, so the JSP 2.0 expression language is enabled.

3) The ${...} is interpreted by JSP 2 before JSTL gets a chance to get a crack at it.

14 years ago
JSP
No problem I am glad it works.

cheers
Martin
14 years ago
Well that error is saying that you do not have the class to run a basic datasource.
Do you have this JAR in your WEB-INF/lib directory:

commons-dbcp-versionNumber.jar

obviously versionNumber in the above would be a number.

You can get it from here:
http://jakarta.apache.org/commons/dbcp/

cheers
Martin
14 years ago
That all looks fine to me, obviously I don't know if you host is correct, I found using the actual IP address to be more effective.

Do you have your Oracle on the standard 1521 port?

Other than that what is the problem do you get an error or?

Can you connect to the database from the machine you are setting up the web app on.

cheers
Martin
14 years ago
Hello no I did not configure the oracle-ds.xml file where is this file found? All the connection information is in the string in the struts datasource.

What is happening that it is not working, any error? And what have you got set up in these properties in your struts-config:


cheers
Martin


Gerardo Casazza
greenhorn
Member # 129962 posted July 26, 2006 02:09 AM
--------------------------------------------------------------------------------
thank you martin, sorry if i bother you once again but my connection is not working yet, did you configure the oracle-ds.xml?

thank you

Gerardo Casazza
greenhorn
Member # 129962 posted July 25, 2006 11:11 AM
--------------------------------------------------------------------------------
Hi I read your post about oracle connection, i tried to do the same
i included classes12.jar where can i get the other jars
(commons-pool-1.3.jar, commons-collections-3.2.jar, jdbc2_0-stdext.jar) ?

thank you
--------------------------------------------------------------------------------
Posts: 0 | Registered: Jul 2006

Martin Thorpe
ranch hand
Member # 73745 posted July 26, 2006 01:30 AM
--------------------------------------------------------------------------------
Hello you will find them all in this list:

http://jakarta.apache.org/commons/components.html

cheers
Martin
[ July 26, 2006: Message edited by: Martin Thorpe ]
14 years ago
I am a total idiot, it was just a typo but has taken me all morning to realise this :-(



should read action NOT ACITON

cheers anyway.
Martin
14 years ago
Hello, I am getting these errors reported by my server in the server.log file when I start the server:





Any idea what this might be, I do have the struts-config file correct with all actions closed:


The only thing I can think is in my action class I am not overriding the execute method just using my own:




Any help, advice or hints would be appreciated.

Thanks for reading.

cheers
Martin
14 years ago