Thanks you for your suggestion,
Unfortunately, this becomes a single user solution. I am unable to find a way to implement this in a multi-user application. Obviously, I cannot create a temporary file for each new user (new session but same JVM?) and have that new file also synchronized between a servlet and a non-servlet.
I am still looking at other solutions as I know many have already implemented this and I am eager...
User Profile
Collapse
-
Thanks you for your suggestion,
Unfortunately, this becomes a single user solution. I am unable to find a way to implement this in a multi-user application. Obviously, I cannot create a temporary file for each new user (new session but same JVM?) and have that new file also synchronized between a servlet and a non-servlet.
I am still looking at other solutions as I know many have already implemented this and I am eager...Leave a comment:
-
Thanks Jamshed,
I am looking into it and also going through your blog entry. Will get back to you soon.
-Cheers
KrishnaLeave a comment:
-
[CODE=java]package org.struts.ets. utility;
import java.lang.refle ct.Constructor;
import java.lang.refle ct.InvocationTa rgetException;
import java.util.Array List;
import java.util.List;
import org.struts.bean .GenericDAOBean ;
public class DynamicObjectCr eation
{
public static void main(String... args)
{
Constructor[] ctors = GenericDAOBean. class.getDeclar edConstructors( );...Leave a comment:
-
krishna81m replied to How do you access application root static pages or WEB-INF jars in a non-servlet clasin JavaI ended up hard coding.. I hate this.
Wish someone could teach me how to use context listener to initialize the variable as string from a servlet's servletContext( ) method and save to application scope and then be able to access this?
Or pass servletContext object itself to the non-servlet.
Help requested.Leave a comment:
-
This is exactly what I thought of initially. The problem with this code really is that you need to know the field names, type of variables that you are setting aprior as in f.setInt(this,i )Code:1. Class c = Class.forName("myClass"); 2. for (i=1; ....) 3. { 4. Field f = c.getField("var" + i); 5. f.setInt(this, i); 6. }
and I have to initialize...Leave a comment:
-
How to create and initialize dynamic variables...
How to create dynamic variables as follows
for(...)
{
Run This( "int var" + i = i;);
}
to be able to create and initialize var1 = 1; var2 = 2;
I was able to do this in a couple of scientific programming languages without any problem..
Help please.. -
Creating a list of objects whose class is known dynamically
I am unable to create a list of objects dynamically. I run a SQL query on the database and populate objects of types that I also know aprior. I read the query as a string, run it on the database and want to be able to populate these objects of classes whose names are known to me also based on the type of the query. In this query, SomeClass is a variable.
Class myClass = Class.forName(" SomeClass");
Object myClassObj... -
Access a servlets data in a non-servlet, threading?
Hello,
I am looking for a solution to update a .jsp page (kind of progress bar) which shows current progress in a huge simulation when users have to wait for longer periods and the way to do it was have the jsp page refresh often and the page data update by a bean containing the properties file details. The main servlet class continously running on the server regularly updates the properties file.
I am currently using... -
krishna81m started a topic How do you access application root static pages or WEB-INF jars in a non-servlet clasin JavaHow do you access application root static pages or WEB-INF jars in a non-servlet clas
In a general servlet class after deployment, you can access the application root as servletContext. getRealPath("/") to access any of the properties files in the "WEB-INF" directory or anywhere else in the /webapp-root/ directory.
How can we get the equivalent servletContext. getRealPath("/") in a non-servlet where you are interested to access a property file located in "/webapp-root/WEB-INF" or... -
Thanks for the replies, I ended up with two solutions for the problem:
1) multiple button boxes which kind of pop up a file for download for each and the user saves it wherever he wants to.
2) links for download, the user clicks each link and a file pops up for him to download.
Thanks for your repliesLeave a comment:
-
Unfortunatley, I have many files that will be downloaded in a single click. So is the unsolved problem.
Any other technology I can use quickly, like a script I can borrow copy paste and starting using?...Leave a comment:
-
krishna81m started a topic How to allow user to browse/provide local folder location/path for downloadin JavascriptHow to allow user to browse/provide local folder location/path for download
A very interesting problem for a simple requirement and not easily available solution:
How would I create a button which will allow the user to specify where the file to be downloaded will be saved to??
The actual problem is that I have multiple drop down buttons (for multiple files) with each of the drop down button containing an option to save to a local folder. Once the user specifies the local path for each of these... -
krishna81m started a topic understanding session tracking in a jsp- servlet - jsp-servlet transitionin Javaunderstanding session tracking in a jsp- servlet - jsp-servlet transition
Could some one please explain why the session is not being maintained when I am doing a forward in a servlet after setting a
cookie. I am even unable to set session attributes or parameters and do a forward from a servlet to another servlet via a JSP
page, the attributes seize to exist. I still do not understand the concept of session tracking.
First page JSP:
_______________ _______________ _______________ __... -
thank you,
I am continuing on this. Trying to understand how simple various data types are read and verified for correct entries. I understood how buff overflows using get(buff,size) can be avoided. So show all data types be read like this and converted to their respective data types using strtol, strod and so on? After doing so, how do we verify if the correct value and size are entered.
In the following example, I...Leave a comment:
-
Thanks a lot. So how would the corresponding code be? Just to read an integer or a character array and so on? Could you give me one detailed example please...Leave a comment:
-
krishna81m started a topic What are stack or buffer overflows, how to test or fix them from occurringin CWhat are stack or buffer overflows, how to test or fix them from occurring
I know that in C++ if we create two char arrays char ch1[3]; ch2[3]; and then do strcpy(ch1,"Hel lo"); this is wrong and if ch1 and ch2 are allocated one by the other, the memory copies part of the array into the other, what are the chances or instances this can occur?
The way I fix this is by forcing the user to enter a fixed number of characters or numbers for the array. But is there a chance that it overflows and goes... -
krishna81m replied to Is there a difference between char* and char [], where/how are they created in memoryin Cthanks a lot jthep,
from what I understand from yours, all of the const variables (such as char a[] = "Hello" and int a[] = {1,2,3,4} ) and non-const variables (such as char* p = a) are created in the stack. whereas all the variables created using new and global are created in the heap.
while int a[] = {1,2,3,4} are stored contiguously meaning a or &a[0] followed by the rest of the elements such that the...Leave a comment:
-
krishna81m replied to Is there a difference between char* and char [], where/how are they created in memoryin CThank you,
I also noticed that when I create ch[] = "Hello" or ch[20] = "Hi;
sizeof actually gives me the size occupied in the memory correctly and strlen gives me the length of the string until I reach the '\0' character. When I create char * I am unable to get the sizeof, I learnt that we can get the address location, atleast print it by using (int *)ch where ch is char[] or char*. Is there a way
...Leave a comment:
-
not a problem at all, unfortunately although I do not work in C++ on a daily basis, I realized of late that I lost my understanding of fundamentals,
may be you could help me with the following:
[HTML]http://www.thescripts. com/forum/thread719257.ht ml
[/HTML]
[HTML]http://www.thescripts. com/forum/thread717947.ht ml[/HTML]Leave a comment:
No activity results to display
Show More
Leave a comment: