package mymail; import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class Mymail { public Mymail(){ super(); } /*REMOVE THIS TO TEST AS JAVA APPLICATION public static void main(String args[]) throws AddressException, MessagingException{ Mymail m =new Mymail(); m.GmailSend("coolasr@gmail.com", "hello", "hello"); }*/ public boolean GmailSend (String to,String subject,String messageText) throws AddressException, MessagingException{ String host="smtp.gmail.com", user="YOUE USERNAME", pass="YOUR PASSWORD"; String SSL_FACTORY ="javax.net.ssl.SSLSocketFactory"; boolean sessionDebug = true; Properties props = System.getProperties(); props.put("mail.host", host); props.put("mail.transport.protocol.", "smtp"); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.", "true"); props.put("mail.smtp.port", "465"); props.put("mail.smtp.socketFactory.fallback", "false"); props.put("mail.smtp.socketFactory.class", SSL_FACTORY); Session mailSession = Session.getDefaultInstance(props,null); mailSession.setDebug(sessionDebug); Message msg =new MimeMessage(mailSession); //msg.setFrom(new InternetAddress(from)); try { InternetAddress[] address = {new InternetAddress(to)}; msg.setRecipients(Message.RecipientType.TO, address); msg.setSubject(subject); msg.setContent(messageText,"text/plain"); // use setText if you want to send text Transport transport = mailSession.getTransport("smtp"); transport.connect(host, user, pass); transport.sendMessage(msg, msg.getAllRecipients());//WasEmailSent = true; // assume it was sent return true; } catch(Exception err) { //WasEmailSent = false; // assume it's a fail return false; //System.out.println("Error"+err.getMessage()); } //transport.close(); } }
Sunday, February 26, 2012
5
Sending E-Mail via G-mail using Java
Monday, February 20, 2012
0
Installing the WASCE WTP Server Adapter
ibm
ide eclipse
Installation
rad
rational application developer
tgmc 2011
web project
webshpere
websphere
The WASCE Web Tools Platform (WTP) server adapter is a tool for deploying and testing Java EE assets to a WebSphere Application Server Community Edition server. Use the Eclipse Update Manger to install the WASCE WTP server adapter from the Eclipse Update Site for IBM WebSphere Application Server Community Edition.
NOTE: same process is followed for WASCE 3.0 JUST DOWNLOAD 3.0 adapter Click to Download Adapter
Information about this tool can be obtained from the Geronimo development tools site and from the tool's on-line help. The following tips supplement that information.
See Developing portable Java EE assets using Eclipse for information about the JEE Profiling feature.
See Using a server in Eclipse and Deploying in Eclipse for instructions on using the WTP Server Adapter after installing it.
See Troubleshooting the WASCE WTP Server Adapter if you have problems.
About the WASCE WTP Server Adapters
WebSphere Application Server Community Edition Version 2 provides a new WASCE WTP server adapter which supports Version 1.1.0.x and Version 2.0.0.0 WebSphere Application Server Community Edition servers. These server runtimes can be downloaded from within eclipse after the appropriate WTP server adapter is installed. The Version 2 WASCE WTP server adapter may also be used to run Apache Geronimo Version 1.1.x and Version 2.0 servers, although this is not supported.
Compatible platforms
IBM has tested the WASCE WTP server adapter on Windows and Linux development environments supported by the Server runtime, running on Intel and AMD platforms with the provided IBM 32-bit Java software development kits (SDKs). The Eclipse IDE does support other platforms, which were not tested and therefore, cannot be recommended.
The tool may be compatible with other system platforms and operating system levels, but to obtain support for a suspected defect, you must demonstrate the defect on one of the recommended development platforms.
Installing the WASCE WTP Server Adapter
There are four options for installing the WASCE WTP Server Adapter:
- the "Download additional server adapters" link
- the Eclipse Update Manager
- the updatesite.zip file
- the deployable.zip file
Installing the WASCE WTP Server Adapter using the "Download additional server adapters" link
- In the Servers View panel at the bottom of the screen, right-click, select New and click Server.
- To show the Servers View panel:
- On the Eclipse menu bar, click on Window, select Show View, and click Other....
- In the Show View panel, expand Server, select Servers and click OK.
- To show the Servers View panel:
- In the New Server panel, click the "Download additional server adapters" link.
- In the Install New Server Adapter panel, select "WASCE v2.0 Server Adapter", and click "Next>".
- Accept the license agreement, and click Finish.
- Click OK to install the server adapter, and restart eclipse for the changes to take effect.
Installing the WASCE WTP Server Adapter using the Eclipse Update Manager
Review the welcome page from the Eclipse Update Site for IBM WebSphere Application Server Community Edition.
Note: Be sure to install the Prerequisite Software before you attempt to install the WASCE WTP server adapter.
Instructions for users familiar with using the Eclipse Update Manager
- Add the URL of the WASCE Eclipse Update site (http://download.boulder.ibm.com/ibmdl/pub/software/websphere/wasce/updates/) as a remote site in your Eclipse update manager, and search for features to install from it.
- To install the Eclipse WTP server adapter for version 2.0 of the WebSphere Application Server Community Edition server, select this WTP Server Adapter:
- WASCE v2.0 Server Adapter 2.0.0
- To additionally install the Eclipse WTP server adapter for version 1.1.0.x of the WebSphere Application Server Community Edition server, also select:
- WASCE v1.1.x Server Adapter 2.0.0
- It is not necessary or recommended to install a server for development and test from the IBM WASCE Runtimes in the update manager list at this time. The appropriate server will be downloaded the first time you click the Download and install button when you define a new server.
Detailed Instructions
- Open the Eclipse Update Manager as follows:
- Help, Software Updates, Find and Install....
- Select Search for new features to install and click Next.
- Create a WASCE Eclipse Update Site as follows:
- Click the New Remote Site... button in the upper right corner.
- Type WASCE Eclipse Update Site (or other suitable unique name) in the Name: field.
- Put the URL of the WASCE Eclipse Update site (http://download.boulder.ibm.com/ibmdl/pub/software/websphere/wasce/updates/) in the URL: field.
- Click OK.
- Select only the WASCE Eclipse Update Site in the Sites to include in search selection box and click Finish.
- Select a mirror and click OK if prompted to do so.
- Expand WASCE Eclipse Update Site, and WTP Server Adapters.
- Install the desired WTP server adapters
- To install the Eclipse WTP server adapter for version 2.0 of the WebSphere Application Server Community Edition server, select this WTP Server Adapter:
- WASCE v2.0 Server Adapter 2.0.0
- To additionally install the Eclipse WTP server adapter for version 1.1.0.x of the WebSphere Application Server Community Edition server, also select:
- WASCE v1.1.x Server Adapter 2.0.0
- It is not necessary or recommended to install a server for development and test from the IBM WASCE Runtimes in the update manager list at this time. The appropriate server will be downloaded the first time you click the Download and install button when you define a new server.
- Click Next.
- Accept the license agreement and click Next.
- Click Finish.
- Click Yes to restart eclipse for the changes to take effect.
Installing the WASCE WTP Server Adapter using the updatesite.zip file
Note: This installation option is only recommended if you can not use the Eclipse Update Manager to install code from the Internet due to firewall or proxy restrictions.
- Visit the welcome page from the Eclipse Update Site for IBM WebSphere Application Server Community Edition.
- Click the link at the bottom of the page to download the updatesite.zip package.
- Extract this package to a directory on your machine, and follow the instructions in Installing the WASCE WTP Server Adapter using the Eclipse Update Manager.
- Instead of using a remote update site, create a local update site from the directory to which you extracted the updatesite.zip package.
Detailed Instructions
- Open the Eclipse Update Manager as follows:
- Help, Software Updates, Available Software
- Add Site
- Create a WASCE Eclipse Update Site as follows:
- Click the Local Site... button in the upper right corner.
- Browse the Local site(extracted folder)
- Click OK
- Expand WASCE Eclipse Update Site, and WTP Server Adapters.
- Install the desired WTP server adapters
- To install the Eclipse WTP server adapter for version 2.0 of the WebSphere Application Server Community Edition server, select this WTP Server Adapter:
- WASCE v2.0 Server Adapter 2.0.0
- To additionally install the Eclipse WTP server adapter for version 1.1.0.x of the WebSphere Application Server Community Edition server, also select:
- WASCE v1.1.x Server Adapter 2.0.0
- It is not necessary or recommended to install a server for development and test from the IBM WASCE Runtimes in the update manager list at this time. The appropriate server will be downloaded the first time you click the Download and install button when you define a new server.
- Click Next.
- Accept the license agreement and click Next.
- Click Finish.
- Click Yes to restart eclipse for the changes to take effect.
- Open the Eclipse Update Manager as follows:
Installing the WASCE WTP Server Adapter using the deployable.zip file
Note: Use this installation option only if all other options fail.
- Visit the welcome page from the Eclipse Update Site for IBM WebSphere Application Server Community Edition.
- Click the link at the bottom of the page to download the deployable.zip package.
- Stop Eclipse.
- Extract this package to your Eclipse directory.
- Use the eclipse -clean option after installing the WTP server adapter.
Troubleshooting the WASCE WTP Server Adapter
Use the eclipse -clean option after installing the WTP server adapter
After installing the WTP server adapter, whether it is the first installation or a subsequent installation of a newer version, start Eclipse with the -clean option. This allows Eclipse to recognize and use the newest version of the WTP server adapter.
Views synchronize when saved
While using the WTP server adapter to customize deployment plans, you may want to use both the form view and the source view. When you are using both views, remember that changes made in one view will not be reflected in the other view until the changes are saved. Be sure to save your changes before switching to a different view.
An IP address change can orphan the server
If the server is running on a host where the IP address has been assigned using DHCP, be sure to stop the server before the IP address changes. For example, you are using a laptop with an Ethernet connection, stop the server before you disconnect and switch to a wireless connection. If you don't, Eclipse will not be able to send a shutdown request to the hidden process where the server is running and if the server is not stopped gracefully, some of the server's configuration changes may be lost.
If the IP address changes while the server is running, you will need to stop the javaw process that contains the server or restart the host. In either case, you will have to repeat any configuration changes that were not saved correctly.
Unable to open Deployment plan editor in Eclipse
This error can occur when opening a WASCE- or geronimo-specific deployment plan without having a WASCE server specified as a "Targeted Runtime". An "IllegalArgumentException" may be thrown. To fix the problem, specify a WASCE runtime as the "Targeted Runtime" for the asset as described in Deploying in Eclipse.
Friday, February 10, 2012
0
Uniform & Sexy forms with JQuery
wanna make your Forms Look attractive ?
Have you ever wished you could style checkboxes, drop down menus, radio buttons, and file upload inputs? Ever wished you could control the look and feel of your form elements between all browsers?
If so, Uniform is your new best friend.
Uniform masks your standard form controls with custom themed controls. It works in sync with your real form elements to ensure accessibility and compatibility.
Uniform styles:
Have you ever wished you could style checkboxes, drop down menus, radio buttons, and file upload inputs? Ever wished you could control the look and feel of your form elements between all browsers?
If so, Uniform is your new best friend.
Uniform masks your standard form controls with custom themed controls. It works in sync with your real form elements to ensure accessibility and compatibility.
Uniform styles:
- Selects (Drop downs)
- Checkboxes
- Radio buttons
- File Upload inputs
Tested & Compatible in:
- Safari 3+
- Firefox 3+
- IE7+
- Chrome
- jQuery 1.3+
- Opera 10+
- Degrades gracefully in IE6
Themes
Theming is central to the philosophy of Uniform. We don’t want you to feel limited to just using the default style. You can design your own theme with our theme kit and create most of the code you’ll need using our custom theme generator.
HomePage URL http://uniformjs.com
![]() | Uniform Default | by Josh Pyles | Download |
![]() | Aristo | by 280North / ported by Josh Pyles | Download |
![]() | Agent | by Collin Allen | Download |
Sunday, February 5, 2012
0
Uploading a File in JSP
file uploading
how to upload file in java
java
jsp
jsp file uploading
uploading
uploading file in java
This Tutorial tell that how to upload a File using JSP .
This tutorial is based on the tutorial i found on tutorialspoint .
I updated the code according to RAD so you can easily work on it .
few things to take care about it are
1. copy the class packages from src folder or you can find in links given bellow
Following example depends on FileUpload, so make sure you have the latest version of commons-fileupload.x.x.jar file in your classpath. You can download it from http://commons.apache.org/fileupload/.
FileUpload depends on Commons IO, so make sure you have the latest version of commons-io-x.x.jar file in your classpath. You can download it from http://commons.apache.org/io/.
2.Make sure you have created directories temp and upload in webcontet folder of your project in
advance.
3. change the filepath to to project workspace use \\ in place of \
4. Download Complete Source
INDEX.JSP
UPLOAD.JSP
This tutorial is based on the tutorial i found on tutorialspoint .
I updated the code according to RAD so you can easily work on it .
few things to take care about it are
1. copy the class packages from src folder or you can find in links given bellow
Following example depends on FileUpload, so make sure you have the latest version of commons-fileupload.x.x.jar file in your classpath. You can download it from http://commons.apache.org/fileupload/.
FileUpload depends on Commons IO, so make sure you have the latest version of commons-io-x.x.jar file in your classpath. You can download it from http://commons.apache.org/io/.
2.Make sure you have created directories temp and upload in webcontet folder of your project in
advance.
3. change the filepath to to project workspace use \\ in place of \
4. Download Complete Source
INDEX.JSP
File Upload:
Select a file to upload:
UPLOAD.JSP
<%@ page import="java.io.*,java.util.*, javax.servlet.*" %> <%@ page import="javax.servlet.http.*" %> <%@ page import="org.apache.commons.fileupload.*" %> <%@ page import="org.apache.commons.fileupload.disk.*" %> <%@ page import="org.apache.commons.fileupload.servlet.*" %> <%@ page import="org.apache.commons.io.output.*" %> <% File file,file1 ; int maxFileSize = 5000 * 1024; int maxMemSize = 5000 * 1024; ServletContext context = pageContext.getServletContext(); String dir = request.getServletPath(); int slashIndex = dir.lastIndexOf('/'); dir = slashIndex != -1 ? dir.substring(0, slashIndex+1) : ""; String temppath= application.getRealPath(dir + "\\temp\\"); //temp directory crete two directory in web content folder dir = application.getRealPath(dir + "\\upload\\"); /* upload directoy if it is not saved then file will not get updated until you restart your RAD/eclipse */ //dir=application.getContextPath(); //String filePath = dir; /*original file path on system Dir path will store image till ur application is running on server */ String filePath = "C:\\Documents and Settings\\Abhi\\IBM\\rationalsdp\\workspace\\uploadtest\\WebContent\\upload\\"; // Verify the content type String contentType = request.getContentType(); if ((contentType.indexOf("multipart/form-data") >= 0)) { DiskFileItemFactory factory = new DiskFileItemFactory(); // maximum size that will be stored in memory factory.setSizeThreshold(maxMemSize); // Location to save data that is larger than maxMemSize. factory.setRepository(new File(temppath)); // Create a new file upload handler ServletFileUpload upload = new ServletFileUpload(factory); // maximum file size to be uploaded. upload.setSizeMax( maxFileSize ); try{ // Parse the request to get file items. List fileItems = upload.parseRequest(request); // Process the uploaded file items Iterator i = fileItems.iterator(); out.println(""); out.println(""); out.println("JSP File upload "); out.println(""); out.println(""); while ( i.hasNext () ) { dir=dir+"\\"; FileItem fi = (FileItem)i.next(); if ( !fi.isFormField () ) { // Get the uploaded file parameters String fieldName = fi.getFieldName(); String fileName = fi.getName(); boolean isInMemory = fi.isInMemory(); long sizeInBytes = fi.getSize(); // Write the file if( fileName.lastIndexOf("\\") >= 0 ){ file = new File( filePath + fileName.substring( fileName.lastIndexOf("\\"))) ; file1=new File( dir + fileName.substring( fileName.lastIndexOf("\\"))) ; }else{ file = new File( filePath + fileName.substring(fileName.lastIndexOf("\\")+1)) ; file1 = new File( dir + fileName.substring(fileName.lastIndexOf("\\")+1)) ; } fi.write( file ) ; fi.write(file1); out.println("Uploaded Filename: " + dir + " "+ fileName + " "); } } out.println(""); out.println(""); }catch(Exception ex) { System.out.println(ex); } }else{ out.println(""); out.println(""); out.println("Servlet upload "); out.println(""); out.println(""); out.println("No file uploaded
"); out.println(""); out.println(""); } %>
Sunday, December 18, 2011
0
Tutorial- RSA (Rational software Architect )
Architecture_ design and construction using the IBM Rational Software Delivery Platform (1 of 9)
IBM Rational Software Delivery Platform- UML modeling (2 of 9)
IBM Rational Software Delivery Platform- Model fuse (3 of 9)
IBM Rational Software Delivery Platform- Design Patterns(4 of 9)
IBM Rational Software Delivery Platform- UML to Java (5 of 9)
IBM Rational Software Delivery Platform (6 of 9)- Ajax Capabilities
IBM Rational Software Delivery Platform- Web Services (7 of 9)
IBM Rational Software Delivery Platform- Java Modeling (8 of 9)
IBM Rational Software Delivery Platform- Java to UML (9 of 9)
IBM Rational Software Delivery Platform- UML modeling (2 of 9)
IBM Rational Software Delivery Platform- Model fuse (3 of 9)
IBM Rational Software Delivery Platform- Design Patterns(4 of 9)
IBM Rational Software Delivery Platform- UML to Java (5 of 9)
IBM Rational Software Delivery Platform (6 of 9)- Ajax Capabilities
IBM Rational Software Delivery Platform- Web Services (7 of 9)
IBM Rational Software Delivery Platform- Java Modeling (8 of 9)
IBM Rational Software Delivery Platform- Java to UML (9 of 9)
Friday, December 9, 2011
2
Download RSA ( Rational Software Architect ) - A tool for software Modeling
class diagram
crystal reports
ibm
ide eclipse
java
Software Requirement Specification
squence diagram
SRS
tgmc
tgmc 2011
tutorial
uml
Unified Modeling Language
websphere
Download via IBM site
Download Via Torrent
Torrent Includes :
Files:13
Size: 5.35 GB (5741557433 Bytes)
IBM® Rational® Software Architect is an integrated analysis, design, and development toolset that supports the comprehension, design, management, and evolution of enterprise solutions and services. It includes design, analysis, and development capabilities for software architects and model-driven developers creating service-oriented architecture (SOA), J2EE, and portal applications.
This product offering includes:
1)Quick Start CD
2)Rational Software Architect
3)Rational Agent Controller
4)WebSphere® Portal test environments
5)Rational ClearCase® LT
6)Crystal Reports Server
7)Activation Kit for Rational Software Architect
8)Rational License Server
9)IBM Installation Manager
10(IBM Packaging Utility
11)WebSphere Application Server for Developers
12)CICS® Transaction Gateway
For more info
http://www-1.ibm.com/support/docview.wss?uid=swg24013690
Download Via Torrent
Torrent Includes :
Files:13
Size: 5.35 GB (5741557433 Bytes)
IBM® Rational® Software Architect is an integrated analysis, design, and development toolset that supports the comprehension, design, management, and evolution of enterprise solutions and services. It includes design, analysis, and development capabilities for software architects and model-driven developers creating service-oriented architecture (SOA), J2EE, and portal applications.
This product offering includes:
1)Quick Start CD
2)Rational Software Architect
3)Rational Agent Controller
4)WebSphere® Portal test environments
5)Rational ClearCase® LT
6)Crystal Reports Server
7)Activation Kit for Rational Software Architect
8)Rational License Server
9)IBM Installation Manager
10(IBM Packaging Utility
11)WebSphere Application Server for Developers
12)CICS® Transaction Gateway
For more info
http://www-1.ibm.com/support/docview.wss?uid=swg24013690
173
Sending sms via way2sms using Java
The sole purpose of the Api is to be used in development by students.so i am not releasing the actual sour
UPDATED CODEcreate a account on http://www.indyarocks.com/after getting indiarocks username and password use the code given below.modify the following detailsput your email id in Email stringput your indiarocks usernameput your indiarocks passwordput number as the number on which you want to send smsput your messgae in messgae string , i limited the length to 110 char for stopping the misuseif you copy the code in your application's jsp page don't forget to import java.net.*,java.io.*,java.net.URLEncoder
Wednesday, December 7, 2011
0
JQUERY VIDEO TUTORIAL PART-2
This tutorial covers
- How to add multiple CSS styles with JQuery
- What are all of the other JQuery selection options
- How to assign events with JQuery
- Explain JQuery animations
- How to change element values with JQuery
- And, a bunch of other things.
0
JQUERY VIDEO TUTORIAL PART-1
This is the first part of JQuery Video Tutorial. It will also cover all of the techniques that go into implementing a dynamic site using Asynchronous JavaScript and XML (AJAX).
It is extremely easy to use AJAX techniques with JQuery. First you must understand that AJAX is not a language, it is just a series of techniques used to dynamically change websites with out page reloads.
If you’d prefer to read about AJAX, here is another article Ajax What is it?
JQuery is just a JavaScript Framework, or function library that will save you a ton of code writing. JQuery also works cross browser, so you won’t care what browser your client uses anymore.
this specifically show you how to do the following in this video:
It is extremely easy to use AJAX techniques with JQuery. First you must understand that AJAX is not a language, it is just a series of techniques used to dynamically change websites with out page reloads.
If you’d prefer to read about AJAX, here is another article Ajax What is it?
JQuery is just a JavaScript Framework, or function library that will save you a ton of code writing. JQuery also works cross browser, so you won’t care what browser your client uses anymore.
this specifically show you how to do the following in this video:
- How to link to the JQuery Framework
- Tons of ways to target specific elements on a web page
- How to change CSS properties dynamically
- What is an anonymous function
- How to execute your JQuery code when a page loads
Sunday, December 4, 2011
1
Top 10 browser Extension For WEB Developers
Firefox: Page Speed
Page Speed is an open-source Firefox/Firebug Add-on. Web masters and web developers can use Page Speed to evaluate the performance of their web pages and to get suggestions on how to improve them. I use Page Speed to optimize my websites.
Chrome: Speed Tracer
Speed Tracer is a tool to help you identify and fix performance problems in your web applications. It visualizes metrics that are taken from low level instrumentation points inside of the browser and analyzes them as your application runs. Speed Tracer is available as a Chrome extension and works on all platforms where extensions are currently supported (Windows and Linux).
Firefox: FireBug
Firebug integrates with Firefox allowing you to edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.
Chrome: Firebug Lite
Firebug team also creates extension for Chrome. So far I have not been able to use firebug in chrome. I am running Google Chrome 5.0.307.11 Beta under Ubuntu Karmic 9.10
Subscribe to:
Posts (Atom)