Matt Sall

Greenhorn
+ Follow
since Jul 01, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Matt Sall

The problem is solved, I use a bean that hold the patterns along with some logic to retrieve the correct pattern in the way you described.

Thank you. I noticed you replied on Sun's forum, if you post your reply there I will award you the duke points.
16 years ago
JSP
Ok, well if you could show me how to prepopulate a map with patterns, which are initparams, it would be great. That is, the patterns are retrieved on the jsp with initParam['theFirstPattern'] and so on. So based on the value the fmt:formatNumber would use the correct pattern with javascript, if it's possible, that is.

I know I can use c:if or c:choose to get the right pattern, but the code duplication would be huge and not very pretty.
16 years ago
JSP
Thank you, that is a possible solution, however, I have many form beans (in a list) that I iterate through on my jsp-page. It would be nice having it on the presentation layer where I think formatting belongs. But if there is no such solution I might have to go with this.

Thanks.
16 years ago
JSP
val is a string representing a BigDecimal. I want to be able to use different formatting for negative and positive values, as well as for null.
val is a property of a form bean in request scope.

Thanks.
16 years ago
JSP
Hi,

The javascript would return a different pattern depending on the value, something like


I don't see how I would do it in the (struts) action class.
16 years ago
JSP


Hi,

is it possible to use javascript as an attribute value in a JSTL tag, e.g.



so that the pattern can be determined at run-time? Any other way?

Thanks.
16 years ago
JSP
Hi,

I have succefully registered an activatable class to rmid. This class, ServerImpl, needs to open a connection to a MySQL database located on another computer. The JDBC driver(mysql.jar) is located on a webserver. The code for this is in the the contructor, like this:

I get an exception when starting the client, which says, "Can't find a suitable driver for jdbc:mysql://hostname/db". Normally you would use Class.forName("com.mysql.jdbc.Driver), but that won't work here(?). How can I load the driver so that this activatable class can see it?

Regards,
Mattias
16 years ago
Problem solved, it was a driver mismatch between server and client.
Hi,

you can use session.setMaxInactiveInterval(arg), session.getLastAccessedTime() and session.getMaxInactiveInterval(), getting session from HttpSession session = request.getSession(boolean arg)

/Mattias
16 years ago
JSP
Hi,

I have started a HSQL server on a linux machine. I can reach it with the database manager, and do select and update querys and everything works fine. However when trying to use the SELECT statment from java code in eclipse an exception is thrown; java.sql.SQLEXception: Connection is broken : Transfer corrupt. But I can do UPDATE, no problem with that.



Server is started with "java org.hsqldb.Server -database dataBase -dbname db -address 192.168.0.2 -port 9001 -silent false -trace true"
Wher dataBase is the name in dataBase.lck, dataBase.script, dataBase.properties, dataBase.log.
The table data is loaded from the script-file when the server starts, could this be the problem?

I can see on my server that user SA is trying to connect, but is the disconnected, any ideas or better still, solutions?

Kind regards,
Mattias
Hi Merrill and thanks for a quick reply.

I knew about the hidden fields trick, however, the data I need to pass is confidential. I was thinking about some scriptlet on the jsp page like,
<%
Type anObject = (Type) request.getattribute("some.data");
request.setattribute("some.data", anObject);
%>

but it doesn't seem to work, any ideas why?

Thanks,
Matt
17 years ago
Hi,

If you need to keep your objects in request scope, what would be the best way to keep data between requests? I.e. between two action classes, like this:

actionclass1 -> jsppage -> actionclass2

Kind regards,
Matt
17 years ago
I used this code to iterate through the collection and print them:

Iterator it = col.iterator();
DynaBean dyna = (DynaBean) it.next();
DynaProperty[] props = dyna.getDynaClass().getDynaProperties();

for (int i = 0; i < props.length; i++) {
String propName = props[i].getName();
String propType = props[i].getType().getName();
String propVal = (String) dyna.get(propName);
System.out.println("Dyna props: " + i + " : " + propName + " : " + propVal + "\n");



}
17 years ago
Problem solved, thanks anyway!
17 years ago