For smart Primates & ROBOTS (oh and ALIENS ).

Showing posts with label Servlet. Show all posts
Showing posts with label Servlet. Show all posts

Wednesday, March 25, 2015

Email Blaster

Email Blaster
*Features
- Send unlimited emails.
- Send test email, so you can see your email format and looks.
- Show real time progress in counting sent emails.
- Show progress in percentage(%)
- Send email both format Text and HTML format.
- Alternate Solution of Cron Job(Less feature).
- Alternate Solution of SQL Agent Job(Less feature).
- Solution of Script Timeout.






















































Share:

Friday, March 13, 2015

Generate excel file in jsp java quickly

When you want to generate excel file in jsp java then you have lot of options,
for ex: jexcelapi, Apache POI,other paid library.
The problem is that the file; first will be created on hard disk then after read it and download to the user’s system.
We all know that the .csv files open in excel software, so we can generate .csv file without any third party library.
It is very simple, quickly, fast and easy to use.

Use listed below code.

showdata.jsp
============================================================
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.text.*" %>
<%@ page import="java.util.StringTokenizer" %>
<%
// made cdb connection here
PreparedStatement psTestUser = conn.prepareStatement("SELECT *from emp");
ResultSet rsTestUser=psTestUser.executeQuery();
String test_login_id,skills_text,desig_text;
ArrayList<String> l1 = new ArrayList<String>();
l1.add("Login,Skills,Design.");
%>
<body>
<a href="download_excel.jsp">download_excel</a>
<table width="100%"  height="600" align="left" border="0">
  <tr>
    <td><strong>User Name</strong></td>
    <td><strong>Designation</strong></td>
    <td><strong>Skills</strong></td>
  </tr>
<%
while (rsTestUser.next()){
%>
  <tr>
    <td><%=rsTestUser.getString("login") %></td>
    <td><%=decryptA(rsTestUser.getString("skills")) %></td>
    <td><%=rsTestUser.getString("design") %></td>
  </tr>
  <%
StringBuilder sb=new StringBuilder();
sb.append(rsTestUser.getString("login")+","+rsTestUser.getString("skills")+",");
sb.append(decryptA(rsTestUser.getString("design")));
l1.add(sb.toString());
}
session.setAttribute("listResult",l1);
%>
</table>
</body>
</html>
<%
// close database connection here
%>


download_excel.jsp
=========================
<%@ page import="java.util.ArrayList"%>
<%
response.setContentType("application/csv");
response.setHeader("content-disposition","filename=test.csv");
ArrayList<String> list = (ArrayList<String>)session.getAttribute("listResult");
for(int i = 0; i < list.size(); i++) {
    String myString = (String)list.get(i);
    out.println(myString);
}
out.flush();
out.close();
%>
Share:

Saturday, December 21, 2013

How to Terminate JSP Process

How to Terminate JSP Process

use:
out.close();
Share:

Thursday, October 10, 2013

Cannot find ActionMappings or ActionFormBeans collection

org.apache.jasper.JasperException: javax.servlet.
ServletException: javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
root cause
javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
root cause
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection


Ans: One of the most common error is that .. that you have missed struts-config file path in web.xml file.

for Ex: <param-value>/WEB_INF/struts-config.xml</param-value>
so change it as <param-value>/WEB-INF/struts-

config.xml</param-value>
Share:

Ads Inside Post

Powered by Blogger.

Archive