File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes save a Web page to an MHT file using  jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "save a Web page to an MHT file using  jsp" Watch "save a Web page to an MHT file using  jsp" New topic
Author

save a Web page to an MHT file using jsp

santhoshkumar samala
Ranch Hand

Joined: Nov 12, 2003
Posts: 156

hi
I have a requirement to save a Web page to an MHT file using jsp
I got it in asp but I dont know how to convert into jsp
this is some ASP code I have to convert this into jsp
------------------------ASP starts here-------------------------------------
<%@ Language=VBScript %>
<html>
<head>
</head>
<body>
<%
' *****************************************************
' ASP script to save a Web page to an MHT file.
' *****************************************************
set mht= Server.CreateObject("ChilkatMHT.ChilkatMHT")
mht.UnlockComponent "UnlockCode"

'***** Get the actual Web Page ******
'**http://www.codeproject.com is the web page to be converted****
'**codeproject.mht is the name of the converted mht file****
mht.GetAndSaveMHT "http://www.codeproject.com",Server.MapPath ("codeproject.mht")
response.write "Saved Codeproject! Home Page"
set mht = nothing
%>
</body>
</html>
-----------------ASP end---------------------------------------------------
here im using the product of chilkatmht if you know any other product please let me know.
(or)
If you have any other idea to convert a web page into mht using java please let me know


santhosh<br />SCJP,SCWCD
rajesh
Greenhorn

Joined: Dec 06, 2003
Posts: 1
if you r creating these webpages from your server , then you can use some thing like a java mail api to create it as a multipart message ( mht- is that type ). and then save it as mht.
but if you are retriving it from some other server. then i am not sure http://www.ietf.org/rfc/rfc2557.txt :roll: , you have to retrive each of links in a page along with the page and then create the multipart-message , will be quite a lot of work..
this is the url for mutlipart-rfc..
santhoshkumar samala
Ranch Hand

Joined: Nov 12, 2003
Posts: 156

thank you rajesh for reply
but I need to get the web page as image(gif/jpeg/..anything) by providing the url . this has to be done in java/jsp
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60978
    
  65

"rajesh",
We're really glad that you are here with us in the JSP forum, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Thanks!
bear
JSP Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: save a Web page to an MHT file using jsp