Natasza Biecek

Greenhorn
+ Follow
since Oct 26, 2006
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Natasza Biecek

Hi,
Once I had similar problem...with old NetBeans (5.5 as I remember).
Try to invoke "clean" command on your project (or "clean & build"),
there's hope it helps...

regards,
Natasza
"Sometimes you have to be silent to be heard", Stanislaw J. Lec
17 years ago
please, do not complain
new week...new challenges, new opportunities, new...yyymmhhh

and remember: Friday is coming
18 years ago
for myself:
"We, children from Bahnhof Zoo" [Hermann, Rieck]
"Sztuka programowania mikrokontroler�w AVR" [Pawluczuk]
(in free translation: 'The art of AVR microcontrollers programming')

and because I really must:
"Core Java 2, Advanced features" [Horstmann, Cornell]

Natasza
18 years ago
love

...when love is a gun...
[Funeral Of Hearts, HIM]
18 years ago

Sorry. I posted the wrong reply at the wrong place.
Sorry to disturb you again.


ok, there's no problem.

Eric, I assumed that you use servlet/jsp and bean, that was my fault...
Please, look at the code below - all set once again:

1) Country.java ( located in 'Test' package)


2) CountryMethod.java ( in 'Test' package, too )


3) RetrievePage.jsp


and let me put some remarks...

to pt.1
why population is stored as String? Don't you think that any numerical
type will be much better (for further calculations for example...)

to pt.2
in your original code (CountryMethod.java) the RetrieveData() method
does not return any data due to void at method signature...do you agree?
my implementation returns ArrayList, data is generated 'by hand',
so, please replace my code with yours to physically read data from db.
And of course add the rest of required stuff...

to pt.3
if you want to display this data, you have to create object
of CountryMethod class, then to call RetrieveData() method, right?
this method returns ArrayList object, so simply iterate through items
and print them out...

please, try to run my code 'as-is', then add whatever you need...

regards,
Natasza
[ November 18, 2006: Message edited by: Natasza Biecek ]
18 years ago
JSP
getAttribute() of HttpSession returns object (java.lang.Object)
http://java.sun.com/j2ee/sdk_1.2.1/techdocs/api/javax/servlet/http/HttpSession.html

so, it has to be casted to string, if not - expect error like this:
"Type mismatch: cannot convert from Object to String."

regards,
Natasza
18 years ago
JSP
hi,
if you retrieve your data in a servlet, simply put array as an attribute
of request before forwarding to JSP page.
I think, it would be better to use ArrayList class to store data, not Object[],
like this:



Then, using <c:forEach> JSTL tag, you can easily read item by item
and present it on the page:

or:


regards,
Natasza
18 years ago
JSP
wow!
It looks so nice but...it doesn't work in my IE
of course there's hope it's something wrong with my M$ browser....but let's assume that not,
so, I did small test: at the beginning of changeuploads() function I added:
alert ( document.getElementById("uploads").tagName )
my IE showed 'FORM' (excuse me?) but Mozilla: 'SELECT' (uff...)
The first: please, use unique names and id-s...I changed id/name of your form adding '_form' suffix.
The second: construction of a table.
When user selects required number of uploads the innerHTML of 'mulup' span will be:
<TABLE><input type="file" name="file_1"<br>......</TABLE><input type="submit">
ooops...?
So, in my opinion, it would be better to do small redesign of this code, it means: to write
simple function returning full content of one row, then to invoke this function as many times
as required. In this way you will generate let's say - interior - of your table.
Finally, <table>,</table> tags and submit button have to be added.
Of course, you can append tr/td/input tags directly in a loop....but when you separate this piece of code
it will be a little bit easier to modify design of this table ( f.e. to set different colors for even/odd rows, etc..)

And the last one...it's a hint only: instead of typing <option value=.....></option> twenty times,
you can use a loop...by the way, you can control max number of uploads, because
value of maxUploads variable may be set dynamically during page generation

Here you have code:


regards,
Natasza
hi


alert(document.getElementById('upload-table').innerHTML);


good move! so, what do you see when this line is uncommented...?
I've seen: "<tbody></tbody><tr><td>.....</td></tr>" as innerHtml...
and after very exciting reading of How to Build Tables Dynamically (the last example)
I added <tbody> to the structure of your table...

Originally posted by Eric Pascarello:
make sure that the name and id are the same.



aha, it's a next problem...so, new rows have ID and NAME set
to avoid empty result of getElementsByName() function...



it worked in IE6 and Mozilla 1.7.3,
now, please verify this script in Firefox...

regards,
Natasza
[ November 02, 2006: Message edited by: Natasza Biecek ]
hi all,

so try to use Boolean class instead of raw boolean...
a piece of servlet

and jsp page:


regards,
Natasza
18 years ago
Hi Tina,

(...)new instance should be launched and used.


hmm...as I understand a new instance of Acrobat Reader?

so, try to prepare a link to your doc in this way:
<a href="any_doc.pdf" target="_blank">a document</a>
it will open a new instance of browser window (with AR inside)
on every click...

regards,
Natasza
18 years ago
JSP
so, Happy Birthday!

yyymmm.... Happy Registerday ?

many
18 years ago