Zoram Paul

Ranch Hand
+ Follow
since Jul 10, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Zoram Paul

Hi All,

Please tell me that from where to find the package javax.jms.* .

Thanks and Regards,
17 years ago
Hi All,

Please tell me that from where to find the package javax.jms.* .

Thanks and Regards,
17 years ago
JSP
Hello experts!

Actually while executing:
String s =config.getServletContext().getRealPath("/");

I got the string as: /home/cascanicacom/public_html/

Thats the root I suppose.

But after getting the root path. Now I need to create a file "write.txt" and save it in the /home/cascanicacom/public_html/ folder.

The code i used before was :
File file = new File("write.txt");

Now please tell me where should I make the changes in the
File file = new File("write.txt"); so as to create it in the server(under /home/cascanicacom/public_html/ folder.).

I even tried:
File file = new File("/home/cascanicacom/public_html/write.txt");

And when I checked in the server theres no file there.

HELP

Thank you so much for all your help.
17 years ago
Hello experts!

Actually while executing:
String s =config.getServletContext().getRealPath("/");

I got the string as: /home/cascanicacom/public_html/

Thats the root I suppose.

But after getting the root path. Now I need to create a file "write.txt" and save it in the /home/cascanicacom/public_html/ folder.

The code i used before was :
File file = new File("write.txt");

Now please tell me where should I make the changes in the
File file = new File("write.txt"); so as to create it in the server(under /home/cascanicacom/public_html/ folder.).

I even tried:
File file = new File("/home/cascanicacom/public_html/write.txt");

And when I checked in the server theres no file there.

HELP

Thank you so much for all your help.
17 years ago
JSP
Thank you Sir,

Let me explain in details:

Actually my First.jsp has the iframe in it which is showing the page (http://industryleadernetwork.com/index.jsp). And there is a submit button in the First.jsp which takes me to the Second.jsp.

In the Second.jsp I want to show the data that has been extracted from the iframe in the First.jsp.

Can you help me Sir?
17 years ago
JSP
Hello,

How can I retrieve data from an iframe?

Please give me some idea.

Thank you
17 years ago
JSP
Dear friends,

Can anyone give me some idea of how to read the content of a page in jsp?

Like I want to read the content(as shown while viewing it in the web browser) of index.html(and not the codes and tags of the index.html) in the website

http://abbeyworkshop.com/howto/java/readFile/index.html

Please if anyone can provide me with some valuable suggestions.



Thanking you,
17 years ago
JSP
No,
No,

That is not the right answer too.

[ UD: Oops, I mistakenly edited this post instead instead of replying. Will post for real now. ]
[ November 15, 2007: Message edited by: Ulf Dittmer ]
17 years ago
JSP
Sorry!!
That is not the right answer.

17 years ago
JSP
Hello Everybody.

I have developed an application which purpose is to shorten a lenghty url entered by the user.

You can check it at http://vividurl.com

This is what my client concluded after the development of the website.

*************************************************************************************
We were using this as a way to simulate concurrent requests for alias
generation. Because all HTTP requests are "stateless", it doesn't matter
where they come from, one IP or multiple IPs. Web application (your code)
treat each as just another request. It didn't pass this test.

One even bigger problem was that this application is not capable of
correctly handling multiple requests. i.e. while the system is handling one
alias-generation request, before the result is returned to user, if another
user request comes in during this period, the system will return two
IDENTICAL alias to both users -- this is unacceptable for any web
application.
*************************************************************************************



Please advice me how to overcome these problems.

Thanks a loads.
17 years ago
JSP
Hello everybody........

Please, Please, Please, Please......... help me out.....

I am using struts framework.

What actually I need to do was:
If an user enters in the url bar as http://zoramurl.com/anything
then the application has to redirect to the home page of the application so that I can check the last word i.e 'anything' in the database and redirect it to its respective url. Something that is similar to www.tinyurl.com


This is what my client has said.........but i couldn't get through...

*************************************************************
The way you deal with this issue has and will create a lot of problems:
1. Having Apache to rewrite the URLs make our application depending on other
server setting, making deployment and maintenance difficult; e.g. what if we
need to a subdirectory (e.g. zoramurl.com/info/*) ? What if we decided to do
away with Apache, instead just use Tomcat?
Apache URL rewriting function is limited comparing to what a RequestProcessor can do; and what you suggested is not its intended usage.
2. Can not handle *.jsp file unless they are hard-coded as action (*.do);
3. Bloated index.jsp, acting partially as a controller

All these problem can be solved by simply using the RequestProcessor:
--> all incoming requests get directed to zoramurl RequestProcessor; (avoid
problem #1)
--> If it is a /*,jsp request, directly dispatch it to *.jsp (avoid problem
#2)
--> If it is a /*.do request, continue let the Struts controller handle it;
--> If it is a /alias request, forward to the alias-resolving action; If
unresolvable, display a friendly message to the user.

>>>
3. It seems that the retrieving/redirecting function has been lagging
behind. To make it work, you probably will need to either write your own
requestProcesser class(preferred) , or extends the ActionServlet class and
use it in web.xml.
All requests including /*.do, /aliases /*.jsp will be processed by this
class and it will then treat them differently.

*************************************************************

I have been trying to do it but all in pain.....
I just couldnt get through.....

Please give me some useful suggestions......


Thanking you for all your help in this forum
17 years ago
Although Valentin Crettaz, your code supports only Internet Explorer and Not FireFox........

Here is a better solution and its working for any browser:

<script>
function cSn(sn, el)
{
if (window.clipboardData) {
window.clipboardData.setData("Text",sn);
} else {
var flashcopier = 'flashcopier';
if(!document.getElementById(flashcopier)) {
var divholder = document.createElement('div');
divholder.id = flashcopier;
document.body.appendChild(divholder);
}
document.getElementById(flashcopier).innerHTML = '';
var divinfo = '<embed src="snippetty.swf" FlashVars="clipboard='+escape(sn)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
document.getElementById(flashcopier).innerHTML = divinfo;
}
}

</script>





[ UD: removed gratuitous graemlins ]
[ September 28, 2007: Message edited by: Ulf Dittmer ]
Hello,

I have a textbox and a button.
When I click on the button I want to copy the textbox value so that I can paste it to anywhere.

Can anyone tell me how to do that using javascript?

Thanks
Hurray.............

I have done it myself...............



17 years ago
JSP

If you give a few details about why exactly you need this behaviour and what you want to achieve, someone could probably give you some suggestions.

But as of now, Ulf Dittmer's answer seems to be the best choice because you will have some directories and pages right? So you need to distinguish between those and these cases where the user types in invalid paths; in the former, you need to serve the resource while with the latter you want to redirect to the home page.

If you're not going to have anything but the homepage then you could use a catch-all url pattern (/*) mapped to your homepage.





So that I can take out the last word from http://www.zorampaul.com/userwords
i.e, the word "userwords" from the http://www.zorampaul.com/userwords

And check out in the database the related word and redirects the user to an url by matching the "userwords" with that of a field in the database.
But for that operation to be done I need the home page. Thats why i have been asking this question how to redirect it to the home page.

Can you suggest now?

Thanks
17 years ago