<script type="text/javascript">
$(document).ready(function()
{
$('.ibutton').click(function()
{
var ajaxdata=$("#country").val();
var value = "country="+ajaxdata;
$.ajax({
url: "saveIt",
type: "POST",
data: value,
cache: false,
success: function(data){
alert("load success");
}
});return false;
});
});
</script>
Friends, i followed every thing but its not working, upon submit, am unable to send the servlet request, saveIt is my url pattern,pls help me.
I have a program where i have a button to change the background color to red and another button to set back the default panel color.
How do i get back the default color for panel??
Currently anybody can access the solr admin page by going to my_ip:8983/solr
I can't have it like that, so how can I make it prompt for password or something?
I have setup my servers apache2.conf file to prompt for password whenever my site is accessed by www.mydomain.com.
But when using another port, the "require password" wont show up.
Any ideas how to secure this?
Don't point me to the SolrSecurity wiki because it's simply too outdated. I have tried it without luck.
Thanks
I have a List with say size n, and i have to dynamically create n variables ie i want to dynamically create the variables depending upon the size of the list. How can i achieve this?
Say i have List as List year with n elements in it;
then i have to create the n Integer variables from the above list.
thanks.
Maps collection is referred to an dictionary because of the way it works.
Each entry into a maps collection involves a pair of objects.
In a maps collection, an object associates the key which determines where the object is stored in the map.
The key object in the maps collection can be duplicated.
A stack which has Last In First Out storage mechanism can be considered as a maps collection.
I think #1,#2,#3 and #5 are Correct in above, but I have doubt with #5. Am I correct?
Hi
I want to know that can two different jvm run in the same machine?
I also want to know more about jvm working.Can any one provide some useful links.
Thanks
If I type '<%# vs <%"' into any of the major search engines, everything is stripped out except the 'vs'. I understand why they do this. I would just like to know if anyone knows of a way to escape illegal characters so that they are searched properly.
I know this is not strictly a programming question, but it is relevant.
This seems like a simple request, but google is not my friend because "partition" scores a bunch of hits in database and filesystem space.
I need to enumerate all partitions of an array of N values (N is constant) into k sub-arrays. The sub-arrays are just that - a starting index and ending index. The overall order of the original array will be preserved.
For example, with N=4 and k=2:
[ | a b c d ] (0, 4)
[ a | b c d ] (1, 3)
[ a b | c d ] (2, 2)
[ a b c | d ] (3, 1)
[ a b c d | ] (4, 0)
I'm pretty sure this isn't an original problem (and no, it's not homework), but I'd like to do it for every k <= N, and it'd be great if the later passes (as k grows) took advantage of earlier results.
If you've got a link, please share.
Am having some arguments say (String a, Treeset b, Set c)
and i try to get the class by arguments[i].getClass(); of the above arguments..
is it possible to get the class of the interface .
ex.,
Class[] argumentTypes = new Class [arguments.length];
for (int i = 0 ; i < arguments.length ; i++)
{
argumentTypes[i] = arguments[i].getClass();
}
I set an request attribute in my action class as follows:
request.setAttribute("xFg",Boolean.TRUE);
I want to retrive this in my JSP. I want to retrive them using JSTL tags. I tried this :
<c:if test="${requestScope.xFg}">
<c:set var="showlist" value="true" />
</c:if>
But c:if didnt work, i mean it didnt goto c:set
I tried to print the sameusing c:out but nothing got displayed. What is wrong or How should i test request attribute value. I havent used requestScope so far. Is requestScope the option to get the request value? pls help.Thanks in advance.
I know add() adds the specified (signed) amount of time to the given time field, based on the calendar's rules.
And roll() adds the specified (signed) single unit of time on the given time field without changing larger fields.
I can't think of an everyday usage of roll() I would do everything by add().
Can you help me out with examples when do we use roll() and when add()?
I was going through threads and I read that ..The notify() method is used to send a signal to one and only one of the threads that are waiting in that same object's waiting pool. The method notifyAll() works in the same way as notify(), only it sends the signal to all of the threads waiting on the object....
Now my query is that if Lets say I have 5 threads and one main thread , so initially the main thread starts and then five other threads start , Now I want to send notification to third thread only , How could it be possible with the use of notify(), since here I am sending notification to third thread only , please advise.
Ok, a friend of mine go back and forth on what "interface" means in programming.
What is the best description of an "interface".
To me an interface is a blueprint of a class, is this the best definition?
Using an oracle database, I need to perform a check to see if a user in my 'users' table is banned or not. The user is banned if his column 'banned' has a value of '1', '0' if he is not.
I have the following working code here:
public boolean banUser(String username)
{//TODO check if user is banned already
try
{
pstmnt = conn.prepareStatement("UPDATE users SET banned = 1 WHERE username = ?");
pstmnt.setString(1, username);
pstmnt.execute();
logger.info("Banned User : " + username);
return true;
} catch ( SQLException e ) { e.getMessage(); }
return false;
}
I'm not sure how to perform an if statement on top of a prepared statement. Any ideas?
Why is it a good practice to mark a class with only private constructors as final? My guess is, it is to let other programmers know that it cannot be sub-classed.
I am trying to find a way to use these methods to save and restore a binary search tree that contains names and phone numbers in each node.
I am just very lost and how to go about doing this.
'public void save(String fileName) {
// TODO : implement this method.
// save bst to its original shape.
}
public void restore(String fileName) {
// TODO : implement this method.
// restore bst from a file, if file exists.
// do nothing, otherwise.
File fichier = new File(fileName);
if (fichier.exists()) {
}
}'