jiju ka

Ranch Hand
+ Follow
since Oct 12, 2004
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 jiju ka

You could transfer the file by any number of ways specifically geared towards file transfer,

We are using REST web services. We are passing some other data along with the file. Hence it will be an HTTP POST method rather than an HTTP PUT.

How big are the files?

File size is arbitrary and is based on user volume. At present we are expecting it to be between 500KB and 50MB.

and if needed send a SOAP message with a reference to the file upload.

How will the xsd look like in this case? Can you please elaborate on various options in representing the File?

Thanks for the reply.
8 years ago

Sorry if this is not the right forum.

Need to pass a file from one system to another using XML. How will I declare the type for file in xsd?

We tried base64Binary as below

But the overhead of using base64 encoding is an over kill for our application.

Thanks for any help.

8 years ago
We are currently using a object tag to display a pdf or .gif file.
There are some buttons around these object tag, like "back" button for navigation.

Hence the page have one url (url1) and object tag have (url 2).
url2 can point to a pdf or .png file.

When the page is rendered on a browser, the action initiating the url1 is part of the first http request to the server.
While the response to the first http request (url1) is rendered, the browser recognizes the object tag and issues a second get request to the server with url 2..

Question : Is there a way to accomplish this by just one http response? That is when the response for url1 is made, a byte stream of
image or pdf can be passed in the request and the browser can render the object tag from the first response itself.

Out of Scope for this discussion: Browser version. Browser version used is IE 8 and it supports object tag.

appreciate any response; If any other forums suite this discussion please feel free to move it there
Another way to do pagination is by using displaytag..

Depending on your non functional requirements... especially the system response time...you may choose a client side pagination or server side pagination.
displayTag is server side pagination.

Few questions about client side pagination..
1. If you have 50 items to display in a page why should the server send all (say around 50000) items to the client?. How much response time and bandwidth you will save if you limit the retry to the page length?
2. Can the limitation to the view (number of items) be passed to the retry mechanism?
3. Do you have sorting to do? if so can it be done at retry side?
4. Are you caching the data in business layer or in session? If you are caching the data, client side pagination is better. But whether to cache or not is a different question.
5. Is your application clustered?
6. Can other users update the data store while one user is viewing?
7. A user can manually go through 8 to 10 pages at a time. If there are 100's of such pages a search/filter utility could limit the number of items.

If the total number of items is negligible, client side pagination is OK.

We use display tag from http://www.displaytag.org/1.2/ along with struts 1, jdk 1.6 and tiles.

Is there a better library than display tags for pagination and sorting of a list of items?

If I understood correct, you are looking to update the properties file based on locale or language.
Many of my considerations are related with environment.

With internationalization you will have various properties files for each locale.

I suggest considering the following.
1. You can pass locale and file name(Eg: "MessageBundle") and read the right properties file. How can you write to the right properties file? So as you said you are writing your own ResourceBundle which loads from db. But what mechanism are you using to write to the properties file.

2. In a clustered environment, how does the write make same changes to all nodes? Will you have property listeners. If it is not clustered do you know whether your website's user community will not increase in future.

3. Many companies have security constraints on writing to property files which are deployed. You said the website is yours. But in future if your companies security constraints change will you be able to write to properties file.?

If you are reading from db, why couldn't you parameterize your properties based on locale in the database itself. In this case you don't need properties file at all. This solution will effectively address scalability and portability issues.
12 years ago
Sorry for not being clear about the class loader issues. I may be wrong in assuming that there will be class loader issues in this case. But I have seen class loader issues which I am writing below.

Suppose we keep the variable in a class as a static variable, initializes the variable when the class is loaded and the class is set to load soon after jvm starts;
there could be other instance of the class called "Class" if another class loader is involved during referencing the variable. In this scenario the actual timestamp is with the first instance of the Class; the second Class don't have the right timestamp.

13 years ago
Yes I meant the time at which jvm started. Not the duration. Thanks for clarifying.

Then the only option is to store it in a variable

Regarding saving the jvm start up timestamp into a variable --
1. Caching the timestamp to a static variable or a singleton object instance will be one solution.
2. Use System.setProperty() to store the timestamp.

Both have drawbacks of garbage collection, class loader issues and security issues.

Is there any other option to store in a variable?

13 years ago
I need to display the jvm start up time.

I don't know how to get the jvm start up time. Can somebody put some light into this please?

I checked the api for System and Runtime classes.

Our jvm once started, runs for many weeks without stop. We have scripts to restart the jvm during deploys. But sometimes these scripts fails and don't do the restart of jvm.
By displaying the jvm start time we will be able to identify whether the script was successful or not. If not successful we will get the option to manually restart the jvm.
13 years ago
I have the following filter in JSP which needs to be replaced with the struts logic tag. How can I refer to the request attributes using the logic tag?

The above code need to be transformed to the following structure

The part where I have the ................... in logic:nonEmpty tag is what need to be filled in.

Thanks in advance.

14 years ago
There may not be many people who can understand c++ program here in java ranch.

Can you please explain what the c++ program above do?

Is the memmory location you are trying to share in a temporary storage or permanent storage?

What is the life span of the memmory to be shared - will it live after the C++ program finish executing?

In the c++ program what is the memmory location you are trying to share?
14 years ago
Shared memmory - the term is mainly used for two programs sharing the same memmory. In this case one program after populating the data in a memmory location , gives the ownership of memmory to the next program. Here the programs heavily depend on the platform and operating system.

I am assuming the above is what you mean by shared memmory.

Object oriented technology and java made these concepts simple. Here sharing have lot of meaning. Sharing could be between two java programs, between two jvms or between two applications.

Between two programs the memmory is shared by reference.

Between two jvms, the contents of memmory is serialized and send to the other system using technologies like RMI, web service etc. Sharing is only virtual here. Ex: session persistence in a clustered environment.

Between two applications running on the same jvm, there are certain system properties shared between. I never encountered a situation like this.

14 years ago
You want to use the reference type as the "parent" and expects to send similar messages to all object it refers; no matter what the implementation class is.

Your issue is in choosing overriding vs overloading.
In overloading you have to use reference types of those classes where the method definitions are.
But in overriding you can use the reference type of the parent class.

So your question is how to convert overloading to overriding. The solution Fred explained above is one.

Another solution is to keep the parameter as a class variable and make sure it is set during construction. But what if this variable don't have anything to do with the state of the object C.

The actual issue is with type differentiation. Below is a similar example.

Here petalId is not representing the state of Flower. So it shouldn't be part of the state of Flower. But it is Ok to have Flower to have a method getPetal(int petalId) eventhough petalId is not used.

So if the parameter don't represent state, Fred's solution is better.
If the parameter represent state, my solution is better.
15 years ago