SonOfTheEARTh
SonOfTheEARTh

Reputation: 1858

Creating jsp pages with struts2 containing forms and other elements

i am working on a struts2 project. in the view layer i need to create forms which have images, hyper links, text, etc. which are not struts2 component tags. As a result when i try to use both of these in my page they are separated as in the struts 2 form components are displayed separately and images and other stuff are displayed separately. How do i make page in which all these stuff lie within the region of the form without separation or unwanted linefeed.

This is a sample problem......

<s:form action="xyz.action"> <s:textfield name="name"/> <img src="abc.png"> <s:textfield name="other info"/> <s:submit/> </s:form>

now what i expect is an image which is displayed between the 2 textfields. but what i get is that image is loaded at a different location(above the entire form). I will also need to use hyper links text in a similar way.

Upvotes: 0

Views: 1634

Answers (1)

Vince
Vince

Reputation: 125

If you use the default theme of struts2, it will decorate the with some extra tag. So if you want to make the behave like normal you have to set the theme to 'simple'. Try this

<s:form action="xyz.action" theme="simple">
     <s:textfield name="name"/> 
     <img src="abc.png"> 
     <s:textfield name="other info"/> 
     <s:submit/> 
</s:form>

Upvotes: 2

Related Questions