« first day (1370 days earlier)      last day (3565 days later) » 

1:11 PM
Ha, I have exactly 1337 rep. leet!
 
1:26 PM
C0ngR4+5
 
 
3 hours later…
4:32 PM
Uh oh, go change that password
I did that a few weeks ago too :/
 
 
1 hour later…
5:47 PM
Zzzzz
 
Can anyone help me on one jsp thing?
 
I could try
 
so can I :P
 
6:06 PM
I want to send some collection object from one jsp page to other jsp page, so thinking to use setAttrib in redirect(). I believe I have to use redirect() because I want to completely redirect to the new page and at the same time. I want this redirect to work only when user clicks on hyperlink.
 
@Appu using a framework ?
 
@ItachiUchiha Nope, I am not using any framework.
 
then you need to pass the collection as a request to the servlet which can forward it to the nest jsp
 
@ItachiUchiha Can you elaborate?
 
Serialize the collection to a form parameter and redirect with the form parameter in the querystring.
How you serialize is up to you. You could probably find a tool to do a base64 serialize.
 
6:16 PM
@spoulson is serialize a better option in this case ?
what about sessions ?
@Appu why not store the collection in a session object
??
 
@spoulson My collection object can contain huge data, so does passing it as a form parameter not make any issue? The same applies with session too. @ItachiUchiha
 
I'm making certain assumptions here
It seems @Appu wants to redirect to the second page.
Sounds like the first JSP needs to output a 302 redirect to the second page with querystring containing the payload.
The payload HAS to be serialized in some way.
It could be comma delimited, JSON, XML, or Base64 encoding, for example.
 
@spoulson Yeah, I want to redirect to another jsp page. How about using java bean? I never used before. But I am looking into this mrbool.com/working-with-java-bean-components-in-jsp/28443 Can this be applied with collections?
 
Alternatively, if the payload is too large for a GET request, you can force a POST request with Javascript. Render HTML with a form prepopulated with your payload and submit it.
 
So, I am thinking to set property with collection object in one jsp page and to get property in the second jsp.
 
6:22 PM
Lastly, you can store the payload in the session state. This may or may not create new problems down the road.
Or store the data somewhere else on the server... database, filesystem, etc.
 
@spoulson this is the best thing in case of large, very large data :P
@spoulson can you throw more light on serialization and its usage in java ?
as I have read many online tutorials and blogs but never understood the real advantage of it
 
@ItachiUchiha how much data are you trying to pass? Is it just a few form entries?
 
You're saying large data, but how large are we talking about?
KB? MB? GB?
 
I know, its used for creating a byte array of the object and then transfer the array through networks, storing them on files etc
and then desirializing them and using the data
but whats the practical use of Serialization ?
 
To be able to store and retrieve data in a specific format. Although using the Serializable interface is less desired
There's specifics and then there's the semantic idea of serialization
 
6:28 PM
13 mins ago, by spoulson
Serialize the collection to a form parameter and redirect with the form parameter in the querystring.
I don't understand how serialization is applied in this case ?
 
Let's say you used base64 serialization on a collection. And it's output looked like "FOOBARFOOBARFOOBAR"
You'd construct a redirect to url using HTTP status 302 with header:
Location: /your_page.jsp?data=FOOBARFOOBARFOOBAR
Then code in your_page.jsp would deserialize Request.parameter("data") back to the collection.
 
output looked like "FOOBARFOOBARFOOBAR" is this the SerialUID/Unique ID which is created for each Serialization object ?
 
That's made up bullcrap
I'm talking about Base64 encoding
 
ahh
ok
 
oh, I understand your question
Base64 takes a byte stream and converts to ASCII-compatible output
 
6:32 PM
gotcha !
 
So yes, you'd need to first serialize the collection to a byte stream using Java's serialization framework.
 
is there a keyword to desrialize ?
or readObject() does the job ?
 
Guys, can I use java bean for this?
 
I wish I could be of more help.
I know enough to ramble about the concepts
But specific Java classes don't register in my memory. :)
 
@spoulson that will be enough, I can experiment the rest :)
thanks
 
6:43 PM
I'm Google-smart.
 
yeah I bet you are
 
7:07 PM
I'm not. I'm just... meh.
 
@Kylar :P
 
Yeah. My stuff isn't fun or glamorous
It's boring
..unless it doesn't work :)
 
@Kylar working on anything interesting ?
 
No... I just said that. My stuff isn't interesting
It's meh
Most of the world's vastly important stuff is boring :)
...unless you break something. Then it gets really interesting and terrifying very quickly
 
are you drunk ? :P
 
7:17 PM
No
Just jaded
What do you do for a living?
Programming, I'm guessing ;)
 
yeah, are you from some other track ?
 
No
 
so you are a canadian settled in cali :P
Tom told me all that :P
 
correct
 
lets try and inject some enthusiasm into you
 
7:23 PM
Haha
Have at it
 
what are your hobbies
 
I have kids instead of hobbies
:)
 
lolz
 
I play ice hockey
 
that was a good one
 
7:24 PM
sometimes guitar
Not much else
 
cool dad !
;)
guitar must the be your tool which you used to impress the mommy ;)
 
And I fight fires and design carrier-grade server systems
@Wortk
Work even
 
fight fire o_O ?
 
Metaphorically speaking
 
ahh, my bad !
If you would have been a fireman as well, you would have been the ultimate dad ! :P
programmer + player + guitarist + fireman = SuperApple (fits your dp) :D
 
7:28 PM
Yeah, I fight engineering fires. Bad code, server problems, etc
occasionally they still let me program
:)
although I mostly do API & Protocol design, server architecture, that kind of stuff now
 
Ahh, so you are basically a Technical Architect !
thats is super cool !
I learnt a lot from the tech arch in my previous project !
A personal question, I am not sure whether it will boost up your enthusiasm or drop it down
 
Sure, hit me. The worst I can do is not answer it
 
@Kylar Have you been a part of any open source projects ?
 
that depends. I have not officially contributed to any, but I use and modify them on a regular basis
 
ahh
have you worked with Swings ?
or java desktop app in particular
 
7:37 PM
I did 8 years of fairly intensive swing work, from around 1999-2006
before I became a server engineer
 
what is a server engg ? Do you work with JavaEE or just servers ?
 
JavaEE is for enterprise type servers
It's way too slow and constrained for the work I do
 
and what kinda work do you do ?
 
Right now I do special projects research
but I most recently was the PIM Server Architect for iCloud
 
PIM ?
 
7:40 PM
Personal Information Management - what we lump a lot of stuff under. Things like bookmarks, contact syncing, calendars
 
gotcha
sounds interesting stuff !
 
Sometimes
 
Is it just today or are you always so jaded ?
 
Have either of you guys used log4j?
 
@pu
Frequently
 
7:43 PM
i guess both of us
 
and with great distress :)
 
@punkrocker27ka shoot your question
@Kylar you shouldn't be !
 
Wait, can I guess first
 
I'm having the hardest time adding it to my project. I'm trying to instantiate a Logger for a particular class.
 
"It can't find the properties file and is defaulting to the wrong thing"
 
7:44 PM
static Logger log = Logger.getLogger(PostProcessing.class);
 
OK looks fine so far
 
you should spent some more time doing what you like rather than spending time on this chatroom :P
@Kylar lolz
 
but getLogger method doesn't exist. (I'm sure it does but it doesn't recognize it). I am importing the correct resource as well.
import org.apache.logging.log4j.Logger;
 
So when you compile it's complaining
 
Can't even compile because Eclipse flags this as an error. getLogger method doesn't exist.
 
7:46 PM
import org.apache.log4j.Logger;
 
org.apache.log4j.Logger
 
is the right import
 
it should be this
lolz
 
LOL
Gotta run, bbiab
 
c ya
 
7:47 PM
isnt it this: import org.apache.logging.log4j.Logger;
 
nope
 
mmmmm.
log4j-api-2.0-rc2.jar
log4j-core-2.0-rc2.jar
these are the two packages I've added
And neither seem to have just org.apache.log4j...
am i adding the wrong jars....
 
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
final Logger LOG = LogManager.getLogger(CustomersCreateController.class);
log4j-1.2.16.jar
this is it
I have pasted it from a previous project of mine
it is using LogManager
you can skip it
 
okay. I think you're on the right track. I'm adding the wrong jars
did you download it straight from here? logging.apache.org/log4j/2.x/download.html
It came with a zip file with a lot of jar files and the instructions on the download page said to add the two that I did. Where on the log4j site can you download the jar that you have?
 
go through this
may be they have changed the imports after 2.x
your import seems to be correct
yes its the diff in 1.x to 2.x
 
8:06 PM
okay that fixed the eclipse error. yep the import changed from Logger to LogManager. Now I need to configure the properties file. Do you have a good one to use for Console and/or DailyRollingFileAppender?
 
lolz
# Root logger option
log4j.rootLogger=INFO, file, stdout

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=D:\\loging.log
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
g2g
c ya
 

« first day (1370 days earlier)      last day (3565 days later) »