Ravish Srivastava

Greenhorn
+ Follow
since Sep 05, 2011
Merit badge: grant badges
For More
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 Ravish Srivastava

Ravish Srivastava wrote:Hi,

How can i create/update a table view using JDBC?

SQL:

CREATE OR REPLACE FORCE VIEW LOGIN_VIEW "USERNAME", "PASSWORD", "HASH", "GROUPNAME"
AS
SELECT USERNAME, PASSWORD, HASH, GROUPNAME
FROM USERTABLE;

Thanks,

This is done.
9 years ago
Hi,

How can i create/update a table view using JDBC?

SQL:

CREATE OR REPLACE FORCE VIEW LOGIN_VIEW "USERNAME", "PASSWORD", "HASH", "GROUPNAME"
AS
SELECT USERNAME, PASSWORD, HASH, GROUPNAME
FROM USERTABLE;

Thanks,
9 years ago
Hi, I could able to resolved bit as, on my java script call i m passing the record id as :
onclick="javascript:tstconfirm('${recordInfo.getId()}');"


and java script method written as :

function tstconfirm(recId){
smoke.confirm('Are you sure you want to delete this record?',function(e){
if (e){
smoke.alert('Confirmed');
alert(recid); // This place I am able to get the correct record id
// here i can call the ajax function to delete the record.
}else{
smoke.alert('Canceled');
}
});

Now issue i am facing is alert "Confirmed" and alert(recid) display simultaneously, at this point browser not waiting Confirmed event from user, it goes ahead and print alert(rec id) too. It means that record gets deleted without user select "Confirmed". what if user decide to not to delete it using "Esc" button from key board.
}

Bear Bibeault wrote:I can find no information about smook.js; what is it?



http://smoke-js.com/
Below is my java program, when i m running it it prints "echo: HTTP/1.1 400 Bad Request".

I am taking input from standard input i.e. from keyboard.




9 years ago
Hi,

I have to validate a json string coming as input request to a method against json schema. if validation is successful then i will pass this json string to a thread which will parse the string and insert into the DB.

Please guide me, how to validate the incoming json string against the json schema in java.

Thanks
9 years ago

I have to exposed a REST service, This service will take json string and then it will verify against the json schema, to check if input json string confirms the json schema. If input json string confirms the schmea then i have to create a asynch thread which will process the json data.

Please guide , how can i perform following:
1. After validation is done, then I have send "Accepted" Message.
2. After validation is successful, create a asynch thread which will be process my json string.

Hi,

I am using smook.js for confirmation from user. i want to get a record id in the javascript function defined for smook.js like below. once user confirms, i can deleted that record.
THis is my JSP script part:

<script>
function tstconfirm(){
smoke.confirm('Are you sure you want to delete this record?',function(e){
if (e){
smoke.alert('Confirmed');
// Want to get the selected record ID here, so that i can call a ajax request to delete the record.
}else{
smoke.alert('Canceled');
}
});
}
</script>
This is my JSP body part:
<div>
<ul id="mytitle">
<li>
<p id="r_id">Record Id</p>
<p id="r_nam">Record Name</p>
<p id="r_des">Record Description</p>
<p id="r_typ">Record Type</p>
<p id="r_action">Delete</p>
</li>
</ul>
<ul id="mylist">
<c:if test="${!empty allrecorddata}">
<c:forEach items="${allrecorddata}" var="recordInfo">
<li>
<a href="editrecord.html">
<p id="r_id">${recordInfo.getId()}</p>
<p id="r_nam">${recordInfo.getName()}</p> // Record Name
<p id="r_des">${recordInfo.getDesc()}</p>
// Record Description
<p id="r_typ">${recordInfo.getType()}</p>
// Record Type
<p id="r_action"><a class="delete" onclick="javascript:tstconfirm();">Delete</a></p>
</a>
</li>
</c:forEach>
</c:if>
</ul>
</div>
Hi All,

Please somebody help on this issue. I have tried all the combination which are suggest on help sites to over come the issue, but i am unable to get rid of the error.
Error:

org.springframework.web.servlet.tags.form.InputTag | Neither BindingResult nor plain target object for bean name 'loginForm' available as request attribute
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'loginForm' available as request attribute
at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:141) ~[spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:178) ~[spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]

Bean Class:

@Entity
@Table(name = "LOGIN")
public class UserVO{


// = null;
public UserVO(){

}

@Id
@Column(name = "USER_ID")
private String userId;

@Column(name = "USERNAME")
private String username;

@Column(name = "PASSWORD")
private String password;

@Column(name = "CREATED_BY")
private String creadtedBy;

// Reference to other associated class
// Getter Setter

}

Controller Class:

@Controller
@SessionAttributes("USERPREF")
public class HomeController{

@RequestMapping(value = "/login", method = RequestMethod.GET)
public ModelAndView showLoginForm(@ModelAttribute("loginForm") UserVO loginForm, BindingResult result){
return new ModelAndView("login", "loginForm", new UserVO());
}

@RequestMapping(value = "/login", method = RequestMethod.POST)
public ModelAndView processForm(ModelMap model, @Valid @ModelAttribute("loginForm") UserVO loginForm, BindingResult result, HttpSession session){
session.setMaxInactiveInterval(30);
ModelAndView view = new ModelAndView();

// Validation Code End.
if(result.hasErrors()){
view.setViewName("login");
view.addObject("loginForm", loginForm);
view.addObject("result", result);
}
else{
// some good businee ,ogic
}

return view;
}

}

JSP :
===========


<section class="col_12 column">
<div class="col_12">
<div class="left">
<p id="title">Hello This is Validation Page</p>
</div>
</div>
<div class="col_12 horizontal">
<form:form action="login.html" method="post" commandName="loginForm">
<div class="inputItem">
<label for="login_userid"><spring:message
code="login.userid" /></label>
<form:input path="userId"
title="Please provide your User Id"/>
<form:errors path="userId" cssClass="error" />
</div>

<div class="inputItem">
<label for="login_password"><spring:message
code="login.password" /></label>
<form:password path="password" title="Password is required" />
<form:errors path="password" cssClass="error" />
</div>
<input class="button" type="submit"/>
</form:form>
</div>
</section>

Spring Configuration xml
================

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">

<!-- Enables the Spring MVC @Controller programming model -->
<mvc:annotation-driven />
<context:annotation-config/>


</beans:beans>


pom.xml
========

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.1.1.RELEASE</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<!-- Hibernate Validator Start -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.0.2.GA</version>
</dependency>
9 years ago
I have seen the concurrent modification exception normally thrown if a Collection is modified while an Iterator is iterating through it.

I was able to receive concurrent modification exception when i executed below code, as i was iterating the list and was removing the item from list:

But once I commented the code to remove item from list and added a line which add a item in the list, I did not received the exception:




Does concurrent modification exception always comes when we Iterator a collection and removes an item from it? Not in case of addition .

Thanks
RS
Hi,

I have an application implemented using Adobe Flex. After login into the application from multiple browser, I can see each time a new session created which is a correct behavior as for our requirement.

I am using java console to check the session information.

Once I launch my application, I verify that in TaskManger i found that javaw.exe instance gets created. But when I log out from the application javaw.exe instance remains appears there in task manger and keeps eating the system resource.

My question is :

1. Does javaw.exe instance maintaining the session information at client end?
2. programaticlly how can I kill javaw.exe instance on logout?

Thanks,

Ravish
10 years ago
Hi,

How to deploy a JAVA application in JBOSS as a Dynamic web Application?

Thanks
RS
11 years ago
Hi,

How to deploy a Java Project on Jboss Server as a web module?

My Java project only has java class.

Thanks,
RS
11 years ago
My bad,

not the source code from the Project A, only the .class files from project A

Thanks
RS
11 years ago
Hi Tim,

My point for dependency was like below:

package my.packB1;

import my.packA1.A1;
import my.packA1.A2;
public class B1{

A1 a1 = new A1();
int i = A2.someMethod();

}
11 years ago