Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!

Azrael Noor

Ranch Hand
+ Follow
since Jul 29, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
53
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Azrael Noor

There are two entities and first entity is referred into second entity.

Entity 1:




Entity 2:



There is no annotation in Entity 2 on reference Yesh; Entity 1 have field annotated with name "YeshName_for_sort". But when i try to access above field as given in following example:

Main Class:



Sorting does not work. I also tried to change statements like:


or


 

but it is not working.

What annotations need to be implemented in entities or any changes in main program to access the field for sorting?
I have 14 piece of code at different places in JSP which is getting repeated at 14 places in JSP:



Requirement to define above chunk at one place and reuse 14 times.

I know i can create its .JSPF and include it again using <% include.

But we want to avoid this as i have to apply same for other chunks too and i am told not to make much files.

So is there any way to define JSP chunk inside page (somewhere in head or foot or in HTML element) and reuse at multiple places on load?

Please consider if we use For Each like:
2 years ago
JSP
We have 5 processes A, B, C, X, Y and Z. In UI of each process; there are 5 Tabs have different types of form.

MoneyPayment(2nd Tab) and Approval(5th Tab) is common.

In MoneyPayment Tab, It have a radio, drop down, date, text and textarea in a Panel and which is cloned again and again with ID's say id0,id1,id2. In Approval Tab, It shows data filled by user in radio, drop down, date, text in MoneyPayment screen.

Question: What are different and best approach in JQuery to display filled data from MoneyPayment(in each panel) to approval tab and that function should be common for all processes?
1) To add attribute data-approval="Yes" (But here we need check to final page as suppose A process show this data but B process does not)
2) Everytime pick each element by ID is again long coding.

Anyone please suggest more inputs if someone have shorten approach

Trying to understand, as i am new to it
persistanceJPAConfig.xml



This have database schema YYY

Now i made new Bean



This bean have different database schema : XXX

In same XML, i see:


But for adding one more database.
what changes should i do in this structure?
Should i create another file?
or
should i create another datasource with different ID and also how MyDAO bean could get that it is to associate itslef with other Database and it's entity have to associate with the new database?
or i need to do some other settings
3 years ago
I have resolved the issue using following:




______

William: Content length varies and for showing content length of inputstream i have to make temporary file(?). Then filename.length will work?
3 years ago
I had a Rest web service call and get InputStream.

Now i want to Write Input Stream to PrintWriter of servlet.

So that it can be downloaded.

I am able to write String and file can be downloaded using following code, i want it to work for Input stream

Following is code:

response.setContentType("application/x-download");
response.setHeader("Content-Disposition", "attachment; filename=\"" + name + ".pdf\"");
response.getWriter().write(is);

Write can take following:
write(String)
write(char[])
write(int)
write(String, int len, int off)
write(char[], int len, int off)

I think char[] will not harm PDF file which is going to download in it
3 years ago
I run following code on Netbeans as well as Eclipse ID and it worked perfectly.

When i take code to runtime environment(say MuleRuntimeEnvironment) it is returning java.io.IOException: Server returned HTTP response code: 405 for URL: http://100.91.17.170:81/Orch21/Orchr.svc/Jobs/




That URL accepts GET as well as POST. I have tested that by changing request method to PUT
What could be the reason for same? any workaround required in Code? or is this Runtime related issue?
4 years ago

Vijitha Kumara wrote:It is not a good practice to have same jar in two locations. If it is shipped with the application server then it should not be packaged in your WAR/EAR files. It will be used from the container.



Suppose we have a single domain in Glassfish or any server have already running projects.

Lib folder contains ABC.JAR.1.0

It is used in two projects.

Now we are deploying a project in same domain of same domain nature
but it use ABC.JAR.1.1, having certain changes which impact previous project which we do not want
but required for new project.

So what to do in that scenario
4 years ago

I have deployed a .WAR file, with ABC.jar in it's LIB folder. ABC.jar has a class containing XYZ Method.

---------

When program is running in .WAR, it is unable to find XYZ method in ABC.jar.

---------

I found same ABC.jar in Lib folder of Glassfish domain(same name version).
I also replaced that ABC.jar with new ABC.jar containing XYZ method.

Still i am getting same exception i.e XYZ method not found.

Question:

Which .JAR file will be picked at first?
The one present in .WAR file or the one present in LIB folder of Glassfish.

Is there any program or code snippet for finding the path of jar, which .WAR program is trying to run?
4 years ago
Hi

I am working on an application, if you could help out which paradigm is correct for implementing:

Client Side: Web Application (HTML/JSP/Servlets)
Intergration: Mule ESB

Client will call Mule ESB flow using HTTP URL and get response from the same

I have two way outs

1) We call Mule ESB from HTML directly and Mule ESB send response back to another JSP page. Then, I need to mention page name inside, Mule ESB flows.

2) Or We call Mule ESB from controller(servlets) and Mule ESB send response back to servlets and then servlets redirect to correct page with manipulated data.

Which of above two is considered as good?

Regards
4 years ago
Hi

I have created a .JSP or Simple HTML. I want to Click a link(Computer Icon) which will open .RDP file (with IP Address, Username, Password).
I have IP Address, Username and Password on Page.

How to Open RDP File, Either Downloaded from server, (if i have 10 RDP connections on page then i need to keep 10 .RDP's on server)
or how to create it on fly?

Is there any API help in creating .RDP on fly. I am not getting concrete answer in Java?

Please enlighten
4 years ago
I also used one more code:



but it is displaying:

Even when jssecacerts is present in C:\Program Files\Java\jre6\lib\security folder
4 years ago
Hi please help me in this. I am using following code:




but i am getting following response:



I have used InstallCert.java to download certificate from same server and i have put it under security folder of JRE 6/7 both and rerun the program but getting same issue while connecting to server.

Please help me out in finding solution for the same.

Thanks
4 years ago

Ulf Dittmer wrote:An interesting alternative for accessing JMX remotely is to run Jolokia on the JVM, which exposes JMX via HTTP - which is easier to work with than the JMX/RMI/JRMP. Java client code is shown at http://www.jolokia.org/client/java.html.



Hi Ulf, Thanks for quick response.

I think remote JVM start here means System Startup?
or some application server startup like Glassfish

we are trying to connect to System not Application server. I have admin rights with me, any suggestion what to check to see that?

Thanks

4 years ago
Hi

I am making a client which fetch load from remote machine. After searches, i found to call getSystemLoadAverage(), but i am unable to connect to remote machine.

Following is snippet in use:



I am using hit and trial to connecting remote system by finding default port found on WWW,
i have found and used following ports:
1099, 8686,9010,9001

but i am unable to connect with any and getting following exception.



Could anyone help in finding default JMX port which could be used to connect that server?
or is there any issue in above snippet?
4 years ago