munish gupta

Greenhorn
+ Follow
since Feb 21, 2012
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 munish gupta

package loc;

import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;

public class TestLOC {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub

String folder = "D:/Personal";

File dir = new File(folder);
FilenameFilter f = new FilenameFilter() {
private String extn;
@Override
public boolean accept(File dir, String ext) {
//System.out.println("fh ===" +ext);
if(!ext.contains(".") || ext.contains(".tif")){
// TODO Auto-generated method stub
return true;
}else{
return false;
}
}

};


f.accept(dir, ".tif");

getLOC(dir, f);
}

private static void getLOC(File dir, FilenameFilter fl) {
// TODO Auto-generated method stub

if(dir.isFile()){
System.out.println(dir);
}else{
//System.out.println("Name ===== " + dir);
File[] f = dir.listFiles(fl);

for(int i=0;i< f.length; i++){
getLOC(f[i], fl);
}
}
}
}
9 years ago
Prasad

I think Scriplets can be used in JSP.

Amit

The method is public and hence can be accessed by static way.

But still I will try using custom tags for this ...

Any other suggestion is most Welcome.....
12 years ago
JSP


The fields are taken from db like:

Cities are in 1 field
cities are mapped against some product codes using HashMap
product codes are maped along with the attributes of products in Hash Map
So that
according to city , products can be taken.
according to product code, product's attribute can be identified

--------------
CODE -------------------------------

<%! List<String> storesList = new ArrayList<String>(); %>


<%
ProductsByCities pbc= new ProductsByCities();
storesList = pbc.getCityList(); // List contains the cities list taken from Database
//getCityList is Non-static method
%>

later on fetching the storesList into option[] of select in HTML.

Its working fine if code is like :

<%
storesList = ProductsByCities .getCityList(); //getCityList is static method %>

12 years ago
JSP
Hi

I am calling a non static method from index.jsp page.
I am getting error.
after making the method static I am able to compile and run.

Why m not able to call a non static java method on JSP page???

Thanks
Munish
12 years ago
JSP
For Knowledge of JSP, Servlets, Java script and CSS i am trying to build a sample application.

Application Brief :

There are 5 gaming stores. Every Store has different products.
The store's list and Product's list are to be read from a property file. [ Hard coded as of now ]
The attributes of products have to be saved in JAVA BEAN.
The StoreWise product's list is stored in HashMap.

Depending on the store selected the product list should gets populated on same page without refreshing the page.

While selecting the store, I am getting the index of selection.
But i am struct while passing this index [ JavaScript variable ] to HashMap [JAVA variable] to get
the storewise list of products.
e.g.
hashmap has key value like
HASHMAP <0> , LIST<a,b,c,d>
<1>,<LIST<e,r,t,y>
<2>,<LIST<e,r,t,y>

LIST is list of products
0,1,2 are indexes of stores


Could you please help regarding same if I can use something else.
Can I use Someother JAVA technology [AJAX or else] for same.

Thanks
Munish.
12 years ago
JSP
What is the Difference between Arguments and parameters ...
12 years ago
Hi

Your problem lies with

public void setIdMetodo(int im) {
idInvocacion = im;
}


Please correct same <<idMetod>> ....
12 years ago