Markus Jura

Greenhorn
+ Follow
since Jun 08, 2004
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 Markus Jura

the xml transformation is not so important. i get a file in my struts action. i can output this file (xml-file) as a string, so that the user can copy the content of the xml-file and paste this content to an xml-file at his own operation system. this solution is not best practises :-(

what i must write in the struts action that the user can download this file? for example he click in the browser at a link and can saved the file. i tried this but it doesnt work:
15 years ago
Hello, i have generate an XML File. At first i have wrote a DOM document. With an other funtion i have transform the DOM document with the class javax.xml.transform:

Now i will that the user can download the generated XML-File from the browser. But i have no idea how i can realize this. Maybe with response.getOutputStream() or something else? Have anyone an idea?
15 years ago
Hello all,
i validate my Application with the Validate-Plugin for Struts.
But i have problems, when i validate nested-attributes, it doesn't work. I can validate only one Arrayfield in an Arraylist:


this does not work:


In my JSP-File i have the following code


has anyone an idea how i can validate all Arrayfields dynamically in an Arraylist?
[ July 23, 2004: Message edited by: Markus Jura ]
16 years ago
Hi,
i have an Application with an Assetlist. The Variables from the Assetlist are id, name, type and comment. The size of the Assetlist is radomize. The randomize list also can edit and saved in the *.jsp-page. In the Backend i created the AssetList with a HashMap and the Variables in the AssetList with a normally String.

public class Room {
private String roomNo = null;
private String comment = null;
private Map assetList = new HashMap(31);
public Room(String roomNo, String comment) {
setRoomNo(roomNo);
setComment(comment);
};
... and so on...

But in the Frontend (FormBean) i must create the variables as a String Array for the logic:iterate ;-)

private String[] name = null;
private String[] comment = null;
... and so on...

My Problem is now a security aspect, because when i create a HashMap with 31 possible entries, the assets aren't listed in the HashMap, i.e. Asset1 is in the HashMap on positin 9, Asset2 is in the HashMap on position 1 and so on...
But in the jsp-page the Variables of the Assets are ordered, i.e. comment[1] is in Asset 1 and so on... When i now manipulate the HashMap, i think that then the Fronend can not reference the correct Asset.

Can anyone tell me how i order a HashMap, after i create it. I DON'T want create a sorted HashMap (i think it called TreeHashMap or something). Maybe a solution is indexId in the logic:iterate or somethin else?!
16 years ago
yes, it is.
i have hear an very simple example. so you can realize two different colors and for each row the color switched:

code:
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<% String[] myCollection = {"entry1", "entry2", "entry3", "entry4", "entry5"}; %>

<table border="0" cellpadding="5" cellspacing="0">
<% String bgColor="#999999"; %>

<logic:iterate id="entry" indexId="rowIndex" collection="<%=myCollection%>" type="java.lang.String">
<tr bgcolor="<%=bgColor%>">
<td>Col 1</td>
<td>Col 2</td>
<td>Col 3</td>
</tr>
<% bgColor = (rowIndex.intValue() % 2 == 0) ? "#FFFFFF" : "#999999"; %>
</logic:iterate>
</table>
16 years ago
no, that is not the problem. okay, i explain it an other way.

you have members with a personalnumber, a firstname, lastname and i.e. a adress.
also you have a searchmask, where you can search for these attributes. when the user searched for the firstname, they get the results. of course the rows of the results are always different...

so and in the resultlist you can edit all fields (personalnumber, firstname, lastname, adress) for each member. then you can submit this new values or you can cancel you action. the new values will be saved in the database.
my problem is how i can display the dynamic resultlist how are all fields editable, because i think the field lastname from the first member has the same name/id as the second member. how struts know that they are multiple different fields (i.e 100 members in the result = 100 different names).
i think maybe a solution is the logic:iterate-method with the key-words property, name, id an indexid - but i don't know how that work.
i hope i explain my problem at a clearer way. sorry, my english is not the best.
16 years ago
I have a program, that get the struts-framework. The application has a tree-structure, like this (the number of the assets, rooms, building are at random generated):

City:Berlin
Building 1:
Room 410:Available
Chair 01Y (user decision)
Table 01N
Chair 70N
Pencil 01Y
Room 333:
...
...
...
Building 22:
Room 1:
...
...
City:Moskau
...
...
...


This is only an example and not my program. I explain that, because my programm is to complex to describe. The User can now make a decision, if the article is availible (edit field)...
So my coretarget is, that the user can open a room-list, but any room has a different number of article. you can also not say, room xy has xy article (static) - that must be dynamic. And the user make a decision, that the developer not know... in the end the user can send (submit) this list or cancel it. I hope struts can that :-)
I Say it an other way. My Problem ist, that i not know, how i can create multiple dynamically edit-fields in one page. How i say above, the number of the fields is always different (random).

Maybe a solution is, that i make one page, where are the article, but the article is always different... So on the one moment in asset_edit.jsp is the article "chair 01", in the other moment in asset_edit.jsp there is the article "table 01" and so on... But i dont know how i make that?

Maybe one of can me give a tip?!
16 years ago