Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Update user profile  RSS feed

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
in my application i use struts and jsp.what i would like to ask is,how i could let the user change his registration data.more precisely,i dont know how i can show this information in jsp..what tags can i use?what i have in mind is for example a form where on the right message "name" for example appears and on the right is a text box which is not empty but has the current saved users name..how can i show this database information in the way i described above?
any help appreciated!
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by natasa jones:
Hi all!
in my application i use struts and jsp.what i would like to ask is,how i could let the user change his registration data.more precisely,i dont know how i can show this information in jsp..what tags can i use?what i have in mind is for example a form where on the right message "name" for example appears and on the right is a text box which is not empty but has the current saved users name..how can i show this database information in the way i described above?
any help appreciated!



Hi natasa,
From what I could comprehend, You want a "Name:TestUser". You may do it by saving the information in a bean and then on the jsp use <bean:write> to do so.
eg:
FIRST NAME:
<input name="name" value="<bean:write name="result" property="name"/>" >

The bean:write will write from the bean(result) and it will write the name of the user. The bean result may contain all the information of the user.

Hope it helps!
Regds,
Roshani
 
RoshaniG Gopal
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi natasa,
From what I could comprehend, You want a "Name:TestUser". You may do it by saving the information in a bean and then on the jsp use <bean:write> to do so.
eg:
FIRST NAME:
<input name="name" value="<bean:write name="result" property="name"/>" >

The bean:write will write from the bean(result) and it will write the name of the user. The bean result may contain all the information of the user.

Hope it helps!
Regds,
Roshani
 
natasa jones
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks very much for your answer!i will try it!as soon as i figure out the prblem with my struts-cobfig!i have written this code


what is wrong with that?because i am getting an error wich says that an instance of this action could not be created!
how should my struts cofig be?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The type attribute must contain the fully-qualified name of the class used by your action including the package name. You must also make sure that this class exists and is in your /WEB=INF/classes directory.

While the method described by RosthaniG will work, it is not the best way to do this in a Struts application. The best, or recommended way is to create a JavaBean that extends org.apache.struts.action.ActionForm that has a corresponding property for every input field in your form. You then declare that ActionForm in the <form-beans> section of your struts-config.xml file. You then associate the name attribute used by the <form-bean> declaration with the name attribute of the action mapping to create an association between the form bean and the action.

Once this configuration is in place, you can populate the form bean in the Action class that forwards to the JSP. If you do this, you can use <html:text> tags for all your input fields and they will automatically be popluated with data from the form bean by Struts.

In order to more fully understand how this process works, I'd suggest you work through a tutorial such as this one.
 
natasa jones
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much for all the information and the link!
 
natasa jones
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could you please tell me how i could fill in the input fields using html:text?
the form appears but the input text fields dont fill in with the values....any solutions???
thanks in advance!
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i think this code would help you



I have stored the details of a member in the list called member info in my action class from the data base and i have used scriptlets to display the values in the text box.
As struts does not allow nested tags inside a tag i think this is the possible way.
try this
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!