User Profile
Collapse
-
struts 2 validation.xml not validating.
I can't seem to get Struts 2 validations to work. I have been converting from Strust 1 to Struts 2. So far I've refactored all the code (for this particular module) on the back end, rewrote the jsp using Struts 2 notations, and wired up the xml (aside from the abc-validation.xml) . Everything runs just fine. If there is an error not generated by user input (i.e. file format problem) I can get that message to come out, so I know my error messages work.... -
I've been thinking about this, and I've come roughly the same conclusion (not yet implemented). I can't just make a non-static method in my beans because I can't make a static call to it. I need to add an abstract getEntityName to the abstract dao, and implement them in the concrete classes. The concrete classes will always use a same (non-generic) bean type so this shouldn't be an issue. Now in the abstract calls wherever I make the T.entityName... -
Generics problem accessing static field
So here is my problem. I have two beans (one extends the other), and I have one DAO class for each to access their tables (using Hibernate). In most cases the queries will be identical so I also have an abstract DAO class (extended by the other two DAOs) which contains the majority of the queries. I had the methods returning beans of the super class which, if need be, I would cast to the subclass. To avoid this casting I want to switch to generics.... -
System cannot find the path specified
I'm having trouble reading in an xml file. My servlet retrieves the file path from the init parameters without a problem, but when I try to create a FileInputStream I get this:
javax.servlet.S ervletException : \WEB-INF\classes\spe cialInstruction s\specialInstru ctions.xml (The system cannot find the path specified)
My file is there, and I can read it in if I create a URL.
ex:
Code:URL xmlPath = servl
-
Encryption
I'm developing a web app, and have some data that needs to be encrypted. I was hoping to find some sort of package of framework that I could easily integerate with hibernate. Does anyone have any ideas? -
JUnit, JNDI, and Hibernate
I'm looking to use JUnit to test some code that uses Hibernate to connect to my DB (SQL Server). Although I can do this using a hibernate.cfg.x ml file I want to create a super class I can extend so I won't have to rewrite code for each TestCase subclass. To make a long story short I'm trying to define some JNDI properties that will include my DB name, username, and password so hibernate can pick it up. I think I have the basics in my setUp method,... -
Thanks for the reply.
The problem I'm running into is that I want all the columns from the table, but when I use the 'max' function i find I need to use 'group by'. This causes more rows to be returned. For example I could have one mgrId with two (or more) effectivedDates :
id - 110
mgrId - 1716
name - Thomas
effectiveDate - 07/07/2002
-and-
id - 127
mgrId -...Leave a comment:
-
Need help rewriting a subselect as a join
I need to select a list of managers from the managerNames table with the most recent effectiveDate. I can do this with the query below:
select mn.*
from (select m.mgrId, max(m.effective Date) as effDate from managerNames m
group by m.mgrId) d, managerNames mn
where mn.mgrId = d.mgrId
and mn.effectiveDat e = d.effDate
Column Defintions:
Id (Pk, NotNull)
MgrId (Fk, NotNull)... -
I did notice one mistake. I was hitting the mssqlserver.jar which is for SQLServer2000. I want to hit sqljdbc.jar which if for SQLServer 2005. So I change my registerDriver to:
Code:DriverManager.registerDriver(new com.microsoft.sqlserver.jdbc.SQLServerDriver());
so my .classpath file now contains:
[HTML]<?xml version="1.0"...Leave a comment:
-
NoClassDefFoundError - please help
I'm using MyEclipse to make a quick one or two use jar utility file to connect to a database and run some updates. I can get everything to compile fine, and create the jar without an issue, but when I execute it from the command prompt I get a NoClassDefFound Error.
Here is the stack trace:
Exception in thread "main" java.lang.NoCla ssDefFoundError : com/microsoft/jdbc/sq
lserver/SQLServerDriver
...Last edited by NamelessNumberheadMan; Aug 2 '07, 02:56 PM. Reason: Attempted somthing Different - still failed -
html:link paramProperty Problem
I'm having issues with my html:link tag. I've tried this two ways.
1) This gets me to my proper dispatch action with the bean:
[HTML]<html:link forward="editMy Info"
paramId="<%=Bea nNames.MY_BEAN_ ID%>"
paramName="myBe an">Edit</html:link>[/HTML]
2)This also gets me to my proper dispatch action without the bean, and without the id:
[HTML]<html:link... -
I would like to simplify my query
What I'm trying to do is get the last entry (by date) for a given entity (which should be a single row). The following returned more than one row:
select termId, entityId, max(enddate)
from Terms
where entityId = 1234
group by termId, entityId
This does return me one row:
select *
from Terms
where enddate in (select max(enddate)
from Terms
where entityId... -
Appolgies for any lack in clarity. I need to copy SMappingID to SID where SMappingID is not null. Then I need to drop the SMappingID column. I'm no DB expert, and was under the impression this would be more complex and require a loop with IFs and Cases. I haven't had the chance to try out the solution yet, but I'll let you know if/when it works.
- Thanks...Leave a comment:
-
Copy one column to another
I have a table I need to make changes to. Dropping columns isn't my problem, but before I drop one of the columns I need to copy the values that aren't null to another existing column in the same table. So for psuedo-code it would be something like:
update Mapping Set SID = (select SMappingID from Mapping where SMappingID is not null)
I don't know if I should be doing this in a loop (which I'm not totally familiar... -
copy one column to another
I have a table I need to make changes to. Dropping columns isn't my problem, but before I drop one of the columns I need to copy the values that aren't null to another existing column in the same table. So for psuedo-code it would be something like:
update Mapping Set SID = (select SMappingID from Mapping where SMappingID is not null)
I don't know if I should be doing this in a loop (which I'm not totally familiar...
No activity results to display
Show More
Leave a comment: