Nems Vedek

+ Follow
since Sep 26, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nems Vedek

Originally posted by dema rogatkin:
Actually IE supports it nicely. However it won't work for you since new pages just appended.

Hmm, do you know is there a way to send n+1 images without appending new pages?

The servlet I wrote works just fine. Although for some reason I must hit refresh/F5 with firefox in order to get it started. With Opera it works just fine. Any idea what's wrong?

Here's some code:

18 years ago

Originally posted by dema rogatkin:
It allows <b>server push</b> model, so for mozila browsers you can just continuously send jpegs and one will be replaced by another.

Yeah, been reading about the "server push"-technology and it seems it is just the thing I need.

But then I found out a page that said "IE doesn't support server push and NN6 has severe bugs in this area."

Aarggh. Sadly IE is still the most popular browser and I really would like to have an feature that worked with IE also.
18 years ago

Originally posted by dema rogatkin:
It's quite possible and will work. What kind of clients do you expect? If just a regular browser, then mozila based browsers will be the best. I use a similar technology for a chat program:

Thanks for the reply. Yes, I'm using browser as a client. Checked out your URL but every link gives me 404 on that page (?)
[ January 23, 2006: Message edited by: Nems Vedek ]
18 years ago
Hello all,

I've created a servlet that fetches single images outside the servlet container/web server based on the parameters I give it and it works like this

The thing I was wondering could it be possible to create a somekind of a continuous stream by modifying the MIME content type and outputting all the images in the ...

... directory?

If not, any ideas how to create a stream/video from n+1 jpeg-images?

18 years ago

as my projects using struts are getting bigger I started to wonder about few design issues.

One thing I've noticed is that if the project is using lot of forms, I end up having even more actions.

For example:

- CreateNewUserAction
- SaveNewUserAction
- EditUserAction
- SaveEditUserAction

and the list goes on and on.

Is this ok or should I learn to use DispatchAction or is there any other approach?

Second thing I have been wondering is the i18n-issue. So far I've been using the file for each language. For me it is not a big issue to hack the .txt-file but let's assume that the customer want's to edit it. Should I just dump the whole and do the localization in DB? If so, how can I maintain the automatic language selection with the browser?

18 years ago

The action is the place to check for valid login, not the JSP.

Yes, this is the way I've been doing it.

Each action must do the check for a valid login, but there are ways to avoid coding the check in every action. One way would be to create a subclass of org.apache.struts.action.Action that does the check and have each of your actions extend this base action.

This sounds like a good idea.

Another way would be to put the logic in a method in a utility class and call the utility method in every action.

At the moment I have foo.mypackage.common- package that holds all kinds of utility stuff for filtering strings/converting dates etc.

Was just wondering is it better to have all the common methods for the webapp in one class or should I seperate the methods to own classes.

I mean like put all the filtering related stuff to one class and login related to another etc.
[ December 22, 2005: Message edited by: Nems Vedek ]
18 years ago
Hello, I was wondering if someone could give me some pointers how to create a password protected webapp "the right way".

At the moment I have all the .jsp's hidden in WEB-INF/jsp so they can only be accessed via actions.

I got a login action that sets ...

... if the given username/password was valid.

Every .jsp uses the same header.jsp and inside the header I have

Any flaws with this kind of design ?

How about protecting the actions ? Meaning that if someone manages to figure out that new users are created with -action and calls it directly. The <logic:notPresent> in the header.jsp doesn't help because it is called after the action has been run.

Should I add something like ...

... to every single action I have ?

[ December 21, 2005: Message edited by: Nems Vedek ]
18 years ago
Is there any built-in function to solve the following:

in admin section there's n+1 users listed and the last column has a <html:link ... /> to ""-action.

Is there any built-in function in struts that would popup a .js-prompt asking for confirmation to the action? ie. "Are you sure yes/no" or should I just copypaste some .js to the .jsp ?

18 years ago

I have a .jsp-form that is populated by the actionform. I also have all kind of other information in this page populated by resultbean (content etc).

Resultbean is saved in the action with request.setAttribute("")

If the validation fails, all the stuff in the resultben naturally disappears because they were saved is request-scope.

The question is, what is the right approach to avoid this ? I know that I can go around this problem by saving the resultbeans to session-scope, but is this really the only way ? It just feels rarther stupid to always put everything to the session.

Does the session-objects take away much memory or strain the server badly ?
How about deleting the stuff from session when the forms action has been called (i.e: validation was successful)

Hmm, have been doing web-stuff with plain .jsp / beans before and it just feels that everything is n+1 times complicated with the struts ...

Anyway thanks if someone bothers to answer ...
18 years ago