问题
i want to set cutom class for session id generation(Custom session id generation) in glassfish server , from my search till now i found that custom class should implement "com sun enterprise util uuid.UuidGenerator" class
so i tried to create my own class as
import com.sun.enterprise.util.uuid;
public class Customsessionid implements UuidGenerator {
public UuidGeneratorImpl()
{
}
public String generateUuid() {
return UuidUtil.generateUuid();
}
public String generateUuid(Object obj) {
return UuidUtil.generateUuid(obj);
}
}
but import gives error as package not found
can anybody help me implementing UuiGenerator class please provide code for sutom session id generation if you can thanks in advance
回答1:
You can't import a package in the way you tried. You have to use a wildcard or import a specific class:
Try this:
import com.sun.enterprise.util.uuid.*;
A detailed explanation of packages and imports can be found here (especially Example 7.5.1-3. No Import of a Subpackage)
来源:https://stackoverflow.com/questions/15933744/custom-session-id-generation-implement-uuidgenerator