Bradusca Luisa

Greenhorn
+ Follow
since Oct 28, 2009
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 Bradusca Luisa

Problem solved:
I forgot to change the name of the formObjectName(I was using formAction pattern)
14 years ago
Hi all, I have a problem with my bean saved in flowScope, it doesn't recognize it-i receive null in my service class function, what could be the problem?

And I ask this because with other beans it works. I copy the code for the beans that would work and I saw that in the moment I change the name of the bean-instead of result="flowScope.a"-wich worked fine to result="flowScope.b" it doesn't work anymore(nullPointerException).

Please someone knows what could be the problem?I have to finish this project in a couple of days.
14 years ago

Paul Clapham wrote:I don't understand. What did you mean to happen, and what actually happened?

Let me remind you that the JSP (including JSTL) runs on the server and generates HTML, which may include Javascript. You didn't say whether this Javascript code was generated by the JSP or not. Then later, after that is all finished, the Javascript may run in the browser, on the client. You can't expect JSTL to do anything at this point.



Hi Paul, thanks for your reply!
Yes, the javascript code was generated by the JSP, and now I understant why ${} couldn't see my index variable because el is executed at server side and javascript at client side.
But how I can do what I meant to do that is: user selects a bean from a select option and I want to appear information about that bean in a div/span..-wich is:name,address,email and so on.(I allready have all the list generated in server side and also I have an index property so that I can choose easier listOfBeans.get(index).)
Thanks in advanced!
14 years ago
Hi all, in my jsp page I have:


And in my javascript function:


And it doesn't takes the index in ${}, but if I use alert(index) it recognize it. What is wrong?
Thanks in advanced
14 years ago
Thanks for your reply! For the Child class I have:

private Parent parent;

@ManyToOne
@JoinColumn(name = "parentId", referencedColumnName = "parentID")
public Parent getParentByParentId(){...}

public void setParentByParentId(Parent parent){...}

private int parentId;

@Basic
@Column(name = "parentId", length = 10,insertable = false, updatable = false)
public int getParentId(){..}

public void setParentId(){..}

So, I have the insertable = false, updatable = false to the parentId column. And how do I insert a Parent then(it will be with the setParentByParentId?)<-because in this case I don't know if it is possible to bind a whole class from the jsp(I don't want in the web flow to make a new search for Parent with it's id when I have already done a search for all)
14 years ago
Hi, I use spring web flow 2 with hibernate annotations. I have a question that may sound stupid but I have to ask it: is there possible that in my jsp using form tags to bind a whole class? I am asking this, because when I generated my entity classes from SQL Server 2008 using Intellij it autogenerated also my @ManyToOne column (it's about 2 tables: one named Leader-with idLeader,name..and so on and another named Phd in wich i have idLeader refered. When I generated my tables with hibernate annotations, in my Phd class intellij put also my @ManyToOne columnm (PhdEntity has now beside the idLeader property, another one refering to Leader class with getter and setter). All was good until I tried to run my application and gaved me the error that i must put insertable = false, updatable = false at idLeader column. Having that done, my application worked perfectly until I had to insert the referenced column idLeader wich doesn't work because I have the insertable = false, updatable = false. In that case it is rationable to insert the class Leader instead of the id(beacause I have the column generated). So in my jsp i have all the ${leaders} in a form:select with the path='Leader' but I can't fix this because it gives me the error that it can't bind String to Leader.class (even if i add a PropertyEditorRegistrar: propertyEditorRegistry.registerCustomEditor(Leader Entity.class,new ClassEditor());
It is possible to bind a whole Leader.class or I have to delete that autogenerated column and let only my idLeader in PhdEntity class?
Thanks in advanced
14 years ago