在用于缓存控制的JSP文件中,我使用了pragma指令作为
///in view did load
view_NoConnectn = [[UIView alloc]init];
[view_NoConnectn setBackgroundColor:[UIColor whiteColor]];
[view_NoConnectn setFrame:CGRectMake(0, frameHeight, frameWidth, 35)];
UIWindow* mainWindow = [[UIApplication sharedApplication] keyWindow];
bool isFound=false;
for(UIView *child in [mainWindow subviews])
{
if([child tag]==007)
isFound=true;
}
if(!isFound)
{
[mainWindow addSubview: btn_setting];
}
[self.navigationController.view addSubview:view_NoConnectn];
////// whereever required
if (show){
if (self.navigationController.view.frame.size.height == frameHeight) {
[UIView animateWithDuration:1.0 animations:^{
[self.navigationController.view setFrame:CGRectMake(self.navigationController.view.frame.origin.x, self.navigationController.view.frame.origin.y, self.navigationController.view.frame.size.width, frameHeight - 35)];
[view_NoConnectn setFrame:CGRectMake(0, frameHeight-35, frameWidth, 35)];
[self.view layoutIfNeeded];
}];
}
}
else
{
if (self.navigationController.view.frame.size.height != frameHeight) {
[UIView animateWithDuration:1.0 animations:^{
[UIView animateWithDuration:0.8 animations:^{
[self.navigationController.view setFrame:CGRectMake(self.navigationController.view.frame.origin.x, self.navigationController.view.frame.origin.y, self.navigationController.view.frame.size.width, frameHeight)];
[view_NoConnectn setFrame:CGRectMake(0, frameHeight, frameWidth, 35)];
[self.view layoutIfNeeded];
}];
} completion:^(BOOL finished) {
[view_NoConnectn removeFromSuperview];
}];
}
}
但是在从w3c验证器验证我的页面时,我遇到了以下错误
元素元素属性http-equiv的错误值pragma。
元素元素属性http-equiv的错误值缓存控制。
所以我正在寻找替代方法来在这种情况下传递w3c验证。
PS:我是JSP和HTML的初学者。在此先感谢
答案 0 :(得分:0)
You can set them using setHeader
.例如
httpResponse.setHeader("Pragma", "no-cache"); // HTTP 1.0