Win a copy of Programming with Types this week in the Angular and TypeScript forum
or The Design of Web APIs in the Web Services forum!

bubu lina

Greenhorn
+ Follow
since Aug 11, 2008
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 bubu lina

found the sollution:


hope this helps somebody
10 years ago
Hello
i apparently know nothing about struts..no matter what i try. that is why i still need some help.
i am using display tag to show some data in a table.(nice library) the issue here is to have a dinamically pagesize.
i have this variable in the .jsp page that has the value = 15 for example. in the display tag i wanna tell the program to take the value of that variable.
tryed like this:

But noo go. tryied only writing "myvar". tryied



can't grasp how this works..struts
Thank you
10 years ago
you were right. Thank you
10 years ago
i specified in the form the name of the action. "/test.do".
or you are saying something else?
10 years ago


and on change in the form this function is called:" onchange="getNrRows(this);"
10 years ago
i am using just javascript to get the selected option.
this being a struts app, i have declared a bean in struts.xml that connects the action to the view. so from the action page i send data to the view page and when the user selects something i want to sent back a value on request.
this should have been as easy as that but something i am missing.
i first used a function(already tested in other examples) to get the value from request :


and so to get the value from the view i used:

This worked with a spring project.
and now here it does not.
10 years ago
Hello
i have problems in sendint the id of a html selected option to a struts action. i use javascript to get the parameter and show it in an alert. it shows the correct value.


the js code:

but now in the strut action action:


I don't get why on request the value() is null......
any ideas? thank you

10 years ago
hello
trying to extract the year from a date database field, i keep on getting sql error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATEPART (year, '2007-06-01')' at line 1



this is what i am trying..and not succeeding...:


i am sure this is wrong... but i don't know the correct syntax for this.
the error occurs in the bussines logic on return:
Trying to load some data from db, using hibernate. It breaks when i call the dao service:

List<TestService> list = service.getTests(date);

calls the

public List<TestService> getTests(String date) {
return testDAO.getTestsDetails(date);
}


that calls the dao..


public List<TestService> getTestsDetails(final String date) {
final List<TestService> details = (List<TestService>) find("from TestServiceTb t where t.modified= '?"
+ date+ "'");

return details== null ? new LinkedList<TestService>() : details;
}



From my servlet controller, it goes to the bussiness logic (

public List<TestService> getTests(String date) {
return testDAO.getTestsDetails(date);
}

) and here it breaks...i get a null pointer exception...don't get why ....


DEBUG HibernateSessionInterceptor(doFilter:52) - ---> cleaning-up session for request [27841632]
ERROR StandardWrapperValve(invoke:260) - Servlet.service() for servlet TestServlet threw exception
java.lang.NullPointerException
at fr.test.services.business.Test.getTestsDetails(TestServiceImpl.java:36)
at fr.test.web.TestServlet.createLastDayLog(TestServlet .java:439)
at dfr.test.web.TestServlet.showSomething(TestServlet .java:417)
at fr.test.web.TestServlet.doPost(TestServlet .java:228)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at fr.test.hibernate.HibernateSessionInterceptor.doFilter(HibernateSessionInterceptor.java:50)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)

this is from my page. i have a for each, of course:
even if i delete the second hidden field..(saveRowId) i still cannot get the right rows
hello
i have this html table that i populate with jstl .
in a hidden field i place the id :

on submit i call a javascript function:


the js script is:



i need to get the IDS from the table of the selected rows. just getting the first id in the list.no matter what i choose. any ideas of where about i am doing wrong here?
thank you
solution found from java sun forum: reader.getXMLReader().parse(new InputSource(new StringReader(XMLMessage)));
10 years ago