-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Problem in reading the value from the database with Hibernat
PostPosted: Thu Aug 26, 2010 11:26 am 
Newbie

Joined: Sun Jul 18, 2010 9:17 am
Posts: 16
Hi Everyone,
I will read from the database the value of "mobileProvider". But it does not work. The storage of data is done with Hibernate.
Below is the code:
Code:
...
<form:form modelAttribute="myAccount">
<table>
...
<tr class="simpletablerow">
      <td>Ihr Handy-Provider</td>
      <td>[color=#FF0040]${myAccount.mobileProvider}[/color]</td>
   </tr>
...
</table>
</form:form>


What am I doing wrong?
Thank you.


Top
 Profile  
 
 Post subject: Re: Problem in reading the value from the database with Hibernat
PostPosted: Fri Aug 27, 2010 3:25 am 
Newbie

Joined: Fri Aug 20, 2010 7:57 am
Posts: 7
Hi,
you are trying to get the value through myAccount.mobileProvider. where mobile provider is an
private field which u cannot use outside u r pojo. so I think it should be like myAccount.getMobileProvider().

let us know if its right or wrong. :)


Top
 Profile  
 
 Post subject: Re: Problem in reading the value from the database with Hibernat
PostPosted: Fri Aug 27, 2010 7:52 am 
Newbie

Joined: Sun Jul 18, 2010 9:17 am
Posts: 16
Hi,
It did not work. I get with myAccount.getMobileProvider() the following error:
The function getMobileProvider must be used with a prefix when a default namespace is not specified

How can I solve this?

Thank you.


Top
 Profile  
 
 Post subject: Re: Problem in reading the value from the database with Hibernat
PostPosted: Fri Aug 27, 2010 8:11 am 
Newbie

Joined: Fri Aug 20, 2010 7:57 am
Posts: 7
Hi,
can u exactly tell me what is myAccount. According to me it should be a single object or list
of object. In case of list of object, In jsp you hav to iterate this object e.g (<c:forEach var)
then you would be able to get the desired value. if not then please check the value of myaccount object at the time when u r setting this for Jsp(to check wheter its contain any value or null u r setting)

Thnx
:)


Top
 Profile  
 
 Post subject: Re: Problem in reading the value from the database with Hibernat
PostPosted: Fri Aug 27, 2010 7:13 pm 
Newbie

Joined: Sun Jul 18, 2010 9:17 am
Posts: 16
Hi,
"MyAccount" is the attribute of the model class "User.java" and I will read out the value of the attribute "mobile provider" from the class "User.java" in the JSP file phonerateinfo.jsp.

How can you do that?

Thank you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.