aspose file tools*
The moose likes Servlets and the fly likes Problems to save serialization Objects with Tomcat using XMLDecoder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problems to save serialization Objects with Tomcat using XMLDecoder" Watch "Problems to save serialization Objects with Tomcat using XMLDecoder" New topic
Author

Problems to save serialization Objects with Tomcat using XMLDecoder

matze ihnsein
Greenhorn

Joined: Aug 11, 2010
Posts: 3
Hello all together,

i want to save some Objects with JavaServlets using the XMLDecoder. But that does not work.

I have this Global function:


an this is the Serialtest Class


and i call the function this way


but all i got is an empty XML file looks like this:


what is my mistake?
he create an object serialtest but there must be some information - an the getter/setter are all set

thanks for your help!


Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Welcome to JavaRanch
matze ihnsein wrote: But that does not work.

TellTheDetails
matze ihnsein
Greenhorn

Joined: Aug 11, 2010
Posts: 3
ok... theres no exception. and the only data whitch is saved is the xml file i post.
to make the serialization work java need to know more --> exept this.


i try on linux and windows with java 1.5 and 1.6 on an tomcat 6 with

C:\Program Files\Java\jdk1.6.0_21\bin>javac.exe -classpath c:\classes\servlet-ap
i.jar;c:\classes\jsp-api.jar;c:\classes\el-api.jar "c:\classes\*.java"

but in my testcase there i not even "extends HttpServlet"

--- in the end i want to save data whitch is saved in Hashmaps (user-data username password etc) i have a class login with a static hashmap...

i hope you no what i mean because my english is not very well...
matze ihnsein
Greenhorn

Joined: Aug 11, 2010
Posts: 3
i found my problem.

i had to save the static hashmap by its own.


in login



this works !
 
Don't get me started about those stupid light bulbs.
 
subject: Problems to save serialization Objects with Tomcat using XMLDecoder