rajiv jackz

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

Recent posts by rajiv jackz

HI


i send url with querystring in different language. for example http:\\aaaa.com\id=1?data=1&website=www.あなたの住所の場所は何ですか.com
i use javascript to fetch the URL. and display in web page..


Then special characters in different language changes to some other like %E3%81%82%E3%81%AA%E3%81%9F%E3%81%AE%E4%BD%8F%E6%89%80%E3%81%AE%E5%A0%B4%E6%89%80%E3%81%AF%E4%BD%95%E3%81%A7%E3%81%99%E3

even if unescape get same problem

i should get as same www.あなたの住所の場所は何ですか.com.

what to do?
Hi

how to set language specific (localization) href->text using jstl

Thanks in advance!
10 years ago
JSP
HI All,

i need to get value matched from previous URL to Current URL accessed

String url=""+PortalUtil..getCurrentURL(request) takes only current URL .

What can i do for previous URL to current URL accessed

How to do it.

Please Help me out Here!

Thanks in Advance
10 years ago
HI
you can go head with display tag

/http://www.displaytag.org/1.2/

this link might be useful. export to excel
10 years ago
JSP
HI all,

How to implement Google Map in spring MVC portlet, I have list of addresses in database

Thanks in advance!
Help me out here

10 years ago
i hope you know what will i value is

for example

for(int i=0;i<10;i++)
{
request.getparameter("status"+i);
}

bold is your need
11 years ago
JSP
i just want load select options using jstl in jsp .
but condition is
1) category have many products
so category must be disabled,
2) one specific category must be set on top index


I have category and product as list available in jsp
eg: category1
product1
product2
category2
product1
product2

Any other way is there without using jstl
please help me out here!
thanks in advance
11 years ago
JSP
HI all,

how to load select options in spring MVC portlet with particular Item highlighted?

i want a specific items to have background color or Highlighted in Jsp form and
also that one particular item to be at topmost item.


public String showForm(RenderRequest request, RenderResponse response, ModelMap model)
{

List<RequestTrialProduct> products = requestTrialProductDao.getProducts();


}


jsp

<form:select path="product" cssClass="cs-send-support" onchange="validate();">
<option value="">Select</option>
<form:options items="${products}" itemValue="code" itemLabel="name" />

-----------------


Help me out here..
Thanks in advance.
11 years ago
HI all,
i need to know how to get current request URL in spring ModelViewController controller but it is spring portlet. i have a code like this.

@RenderMapping
public String showForm(RenderRequest request, RenderResponse response, ModelMap model)
{
---------
---------
---------

}
i need it in portlet

please any one help me?

Thanks in Advance!
11 years ago
above mid point formula was not working

please anyone help me out here???

i need mathematical formula ???
11 years ago
java code or formula to find centre point (x,y) of line??

actually i used mid point formula x1,y1

x2,y2 then

i used (x1+x2)/2
(y1+y2)/2
11 years ago
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/iportal?
useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root
theme.css.fast.load=false
theme.images.fast.load=false
javascript.fast.load=false
javascript.log.enabled=true
layout.template.cache.enabled=false
browser.launcher.url=
openoffice.cache.enabled=false
velocity.engine.resource.manager.cache.enabled=false
com.liferay.portal.servlet.filters.cache.CacheFilter=false
com.liferay.portal.servlet.filters.themepreview.ThemePreviewFilter=true




how can i disable web cache and set changes while working???


what is portal_normal.vm and 1_2_1_columns.wap.tpl?
11 years ago
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.ResultSet;

public class JDBCTest {

public static void main(String[] args) throws Exception {
String url = "jdbc:oracle:thin:@192.168.10.133:1521:XE"; //"jdbc:oracle:thin:@localhost:1521:orcl";
String driver = "oracle.jdbc.OracleDriver";
String user = "RAM";
String password = "PWDXS";

try {
Class.forName(driver);

System.out.println("#########################################");

//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection(url, user, password);

// Get the MetaData
DatabaseMetaData metaData = conn.getMetaData();

// Get driver information
System.out.println("");
System.out.println("#########################################");
System.out.println("# ***DRIVER INFORMATION***");
System.out.println("#");
System.out.println("# Driver Name = " + metaData.getDriverName());
System.out.println("# Driver Version = " + metaData.getDriverVersion());
System.out.println("#");
System.out.println("#########################################");
System.out.println("");
System.out.println("");

// Get database information
System.out.println("#########################################");
System.out.println("# ***DATABASE INFORMATION***");
System.out.println("#");
System.out.println("# Database Product Name = " + metaData.getDatabaseProductName());
System.out.println("# Database Product Version = " + metaData.getDatabaseProductVersion());
System.out.println("#");
System.out.println("#########################################");
System.out.println("");
System.out.println("");

// Get schema information
ResultSet schemas = metaData.getSchemas();
System.out.println("#########################################");
System.out.println("# ***SCHEMA INFORMATION***");
System.out.println("#");
System.out.println("# Schemas:");
while (schemas.next()) {
System.out.println("# " + schemas.getString(1));
}
System.out.println("#########################################");
System.out.println("");
System.out.println("");

// Get table information
System.out.println("Tables");
ResultSet tables = metaData.getTables("", "", "", null);
while (tables.next()) {
System.out.println(tables.getString(3));
}
conn.close();
} catch (Exception ex) {
ex.printStackTrace();
}
System.out.println("############end#############################");
}
}

How to get user information with this jdbc code.??? provide me solution
Displaytag to display EXCEL NOT WORKING

java.lang.NullPointerException
>>>> at
>>>> com.opensymphony.module.sitemesh.taglib.decorator.HeadTag.doEndTag(HeadTag.java:33)
>>>> at
>>>> freemarker.ext.jsp.TagTransformModel$TagWriter.endEvaluation(TagTransformModel.java:431)
>>>> at
>>>> freemarker.ext.jsp.TagTransformModel$TagWriter.onStart(TagTransformModel.java:370)
>>>> at freemarker.core.Environment.visit(Environment.java:295)
>>>> at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130)
>>>> at freemarker.core.Environment.visit(Environment.java:209)
>>>> at freemarker.core.MixedContent.accept(MixedContent.java:92)
>>>> at freemarker.core.Environment.visit(Environment.java:209)
>>>> at freemarker.core.Environment.process(Environment.java:189)
>>>> at freemarker.template.Template.process(Template.java:237)
>>>> at
>>>> org.apache.struts2.sitemesh.FreeMarkerPageFilter.applyDecorator(FreeMarkerPageFilter.java:160)
>>>> at
>>>> org.apache.struts2.sitemesh.TemplatePageFilter.applyDecorator(TemplatePageFilter.java:116)
>>>> at
>>>> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:62)
>>>> </code>
>>>>



package com.customer;



import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.util.ServletContextAware;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ModelDriven;

public class CustomerAction implements ModelDriven<Customer>,ServletContextAware{

Customer customer = new Customer();

//<constant name="struts.devMode" value="false" />


ServletContext servletContext;
CustomerBo customerBo;
List customerList=null;
// DI via Spring

public void setCustomerBo(CustomerBo customerBo){
this.customerBo = customerBo;
}

@Override
public Customer getModel() {
return customer;
}

public String addCustomer() throws Exception{

// to save
customer.setCreatedDate(new Date());

WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
CustomerBo customerBo =(CustomerBo) wac.getBean("customerBo");
// setCustomerBo();

customerBo.addCustomer(customer);

customerList = customerBo.listCustomer();

listCustomer();

return "success";
}
//update customer
public String updateCustomer() throws Exception{

// to save
customer.setCreatedDate(new Date());
setCustomerBo2();
customerBo.updateCustomer(customer);
customerList = customerBo.listCustomer();

return "success";
}

// list all customers
public String listCustomer() throws Exception {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
CustomerBo customerBo =
(CustomerBo) wac.getBean("customerBo");
// setCustomerBo();
customerList = customerBo.listCustomer();
ActionContext ctx = ActionContext.getContext();
HttpServletRequest request = (HttpServletRequest) ctx.get(ServletActionContext.HTTP_REQUEST);
request.setAttribute("customerList", customerList);


return "success";
}



public void setCustomerBo2()
{
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
customerBo = (CustomerBo) wac.getBean("customerBo");

}

public String deleteCustomer() {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
customerBo = (CustomerBo) wac.getBean("customerBo");
//setCustomerBo2();
customerBo.deleteCustomer(customer);
customerList =customerBo.listCustomer();
ActionContext ctx = ActionContext.getContext();
HttpServletRequest request = (HttpServletRequest) ctx.get(ServletActionContext.HTTP_REQUEST);
request.setAttribute("customerList", customerList);
return "success";
}

public void setCustomerList(List<Customer> customerList) {
this.customerList = customerList;
}

@Override
public void setServletContext(ServletContext context) {
// TODO Auto-generated method stub
this.servletContext = context;
}
/*public List<Customer> getCustomerList()
{
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
customerBo=(CustomerBo)wac.getBean("customerBo");
customerList = customerBo.listCustomer();

return customerList;
}*/

} CODE HAS exception


package com.customer;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateTemplate;

public class CustomerDAOImpl implements CustomerDAO {

private HibernateTemplate hibernateTemplate;

public void setSessionFactory(SessionFactory sessionFactory){
this.hibernateTemplate = new HibernateTemplate(sessionFactory);
}
@Override
public void addCustomer(Customer customer) {
hibernateTemplate.save(customer);
}
@Override
public void updateCustomer(Customer customer) {
hibernateTemplate.update(customer);
}
@Override
public void deleteCustomer(Customer customer) {
hibernateTemplate.delete(customer);
}

@Override
public List<Customer> listCustomer() {

List<Customer> cust = hibernateTemplate.find("from Customer");
//List<Customer> cust2 = hibernateTemplate.findByValueBean(queryString, valueBean)
//List<Customer> cust2 = hibernateTemplate.findByCriteria(criteria)
//List<Customer> cust3 = hibernateTemplate.findByExample(exampleEntity);
return cust;
}
}

package com.customer;

import java.util.List;

public interface CustomerDAO {
void addCustomer(Customer customer);
void updateCustomer(Customer customer);
void deleteCustomer(Customer customer);
List<Customer> listCustomer();
}


package com.customer;

import java.util.List;

public class CustomerBoImpl implements CustomerBo{

CustomerDAO customerDAO;

public void setCustomerDAO(CustomerDAO customerDAO) {
this.customerDAO = customerDAO;
}
@Override
public void addCustomer(Customer customer) {
// TODO Auto-generated method stub
customerDAO.addCustomer(customer);

}
@Override
public void updateCustomer(Customer customer) {
// TODO Auto-generated method stub
customerDAO.updateCustomer(customer);

}
@Override
public void deleteCustomer(Customer customer)
{

customerDAO.deleteCustomer(customer);

}

@Override
public List<Customer> listCustomer() {
// TODO Auto-generated method stub
return customerDAO.listCustomer();
}
}

package com.customer;

import java.util.List;

public interface CustomerBo {

void addCustomer(Customer customer);

void deleteCustomer(Customer customer);

void updateCustomer(Customer customer);
List<Customer> listCustomer();
}

11 years ago